257 Commits

Author SHA1 Message Date
b21f2efa91 Doxygen: Unify group definitions and add \files
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-03-07 10:10:16 +01:00
3fd6e5b604 Doxygen: Add static functions and templates
Marking all global functions and templates as static made Doxygen hide
them from the documentation. However, they were marked as static because
of the portable nature of WinStd. Not to isolate them.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-03-07 10:09:16 +01:00
ad76305ce9 Remove deprecated methods
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-03-03 15:51:13 +01:00
266996bd67 Add winstd::thread and winstd::process_snapshot
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-03-03 09:17:22 +01:00
24f11e5253 Deprecate helper methods of "smart-pointer" classes
The helper methods, which are so simple they merely assign the pointer/
handle to the class instance, were simply marked depreciated.

The helper methods, which require extra variable to store the output
pointer/handle before assigning it to the class instance, were replaced
with function overloads named by the original function helpers initially
wrapped. This allows easy porting of the legacy code to use WinStd
classes.

This commit also splits the helper functions to A and W (_UNICODE)
variants.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-03-02 15:26:27 +01:00
328646b2d9 Stop defining _WINSOCKAPI_
Being portable means not interfering with *any* user project settings.
Adapt user projects accordingly when sockets are used.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-10 12:16:34 +01:00
e2aad54a13 Add file_mapping and UnmapViewOfFile_delete
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-10 12:13:10 +01:00
29a9d1d69f Update documentation
Although, most of the Windows handles may be duplicated with
DuplicateHandle(), this requires knowledge of the processes, desired
access and what not. The dplhandle<> supports only trivial duplication.

Hence win_handle is not a child of dplhandle<>, but handle<> instead.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-10 12:12:25 +01:00
2493f3790e Add event_log
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-09 12:04:48 +01:00
0029a491a9 Readme: Link to gh-pages documentation
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 14:37:04 +01:00
21c1bf5084 Doxygen: Address warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 14:37:04 +01:00
e3d9fffd4f Doxygen: Suggest #include <WinStd/header.h>
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 13:57:39 +01:00
2bfb369692 Move vector_queue from WinStd to stdex
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 13:49:05 +01:00
89a79c330b Doxygen: Instruct GitHub Actions to build documentation on push
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 13:23:29 +01:00
f4a39589a1 Doxygen: Update configuration
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 13:19:18 +01:00
921aa9f4e9 Discontinue forward declarations
They are pain to maintain. We'll use them only if really needed (cyclic
dependencies).

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 13:06:34 +01:00
e513782854 Use explicit char/wchar_t type for ...A/W Win32 API
Using template type for string type could potentially allow mixup of
MBCS and UCS-2/UTF-16 strings. Fortunately, MSVC errors where char*/
wchar_t* are not aligned with LPSTR/LPWSTR.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 09:54:01 +01:00
04c2f9b9c3 Reuse free_internal() when destructing the handle<> implementations
Depending on the settings, compiler inlines the free_internal() call
inside the destructor. No need to copy&paste code.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-04 09:18:45 +01:00
4520593e49 Readme: Update examples
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 16:07:51 +01:00
7fab825e5f Readme: Remove AppVeyor badge
Going portable, there is no project left to build in this repo. Maybe
I add some unit tests one day?

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 15:58:15 +01:00
081df56d18 Fix MsiFormatRecordW forward declaration to match implementation
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 15:46:25 +01:00
918cdb9cd6 Switch to MIT license
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 15:39:44 +01:00
cd025b449a Move Hex from WinStd to stdex
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 15:12:27 +01:00
465c52f0a0 Discontinue manual inline hinting
Compiler knows better than we do.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 15:05:30 +01:00
880fd34e16 Move our Base64 implementation to stdex
Base64 is general algorithm not provided with Win32 API.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 13:42:46 +01:00
c49ea10055 Migrate static data class members into static data namespace members
MSVC linker can't merge former, but can the later ones.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 13:03:53 +01:00
5c9d716409 Silence dead-code warnings
This is library to be used by other projects and we cannot/do not want
to know in advance which functions will be used and which not.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 12:58:52 +01:00
6e34783ed5 Make code portable
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-03 11:53:45 +01:00
7882064e0b Add WINSTD_ prefix to some macro names
This minimizes name collisions with other projects.

Signed-off-by: Simon Rozman <simon@rozman.si>
2022-01-27 09:47:58 +01:00
9642f0d1d5 Add QueryFullProcessImageName helpers
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-01-26 08:57:08 +01:00
0d56d79c35 Update Copyright year
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-01-07 11:20:07 +01:00
27f3946c4f Redirect output files to the output folder
Thou linker can locate the output .lib file of referenced projects
wherever .lib is just fine, this helps us to gather all .pdb files in
the output folder.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-12-01 07:17:34 +01:00
59d8772301 Cleanup project files
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-12-01 05:54:07 +01:00
b141aebea6 AppVeyor: Remove Visual Studio 2017 from build matrix
As we no longer explicitly set WindowsTargetPlatformVersion property,
AppVeyor Visual Studio 2017 builders assume 8.1 SDK for ARM64 too,
resulting in an unknown platform.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-30 14:43:04 +01:00
fc67cb4d05 Cleanup project files
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-30 14:43:04 +01:00
2494076ea2 AppVeyor: Add Visual Studio 2022 to the build matrix
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-30 09:52:29 +01:00
a070ee6c23 Merge 2017 and 2019 project files
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-30 09:52:29 +01:00
eb73ce92ed Switch to SPDX license notice
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-22 12:59:00 +01:00
7188af8e71 Cleanup WINSTD_NOVTABLE/__declspec(novtable)
This was originally intended as a compiler hint.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-19 15:02:52 +01:00
82935bd8e0 Unify Windows.h inclusion
Windows.h must be included first and must be included with care
regarding WinSock.h and WinSock2.h affair.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-15 11:35:08 +01:00
b8816476e5 Introduce basic support for Windows GDI resources
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-04-01 09:27:15 +02:00
51b262b382 Cleanup WINSTD_API and WINSTD_NOVTABLE
WINSTD_API: the WinStd is never compiled as DLL any more. No public
function or class needs __declspec(dllexport)/__declspec(dllimport) any
more.

WINSTD_NOVTABLE: inlined

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-30 11:59:18 +02:00
96197da77e Introduce NormalizeString<>()
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-25 10:33:24 +01:00
96e1882405 Copyright: Bump year
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-25 08:32:57 +01:00
7196b4298e Add UTF-8 BOM markers
MSVC needs them to use correct charset when Language for non-Unicode
programs is set to Windows-1252 or anything different than UTF-8.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 10:53:10 +01:00
af734beeba Use more appropriate SAL annotation for _FormatMessage_format_string_
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 10:00:34 +01:00
85075cd419 Introduce reg_key::delete_subkey() method
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-06-29 15:15:36 +02:00
b5c020c732 Resolve code analysis reported warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-06-29 14:04:57 +02:00
7c5f20d756 Address code analysis warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-13 10:55:23 +01:00
73619821ee Address code analysis warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-12 19:27:07 +01:00