diff --git a/common/hooklib/path.h b/common/hooklib/path.h index 3508d0b..9e5ba13 100644 --- a/common/hooklib/path.h +++ b/common/hooklib/path.h @@ -5,24 +5,11 @@ #include #include -typedef HRESULT (*path_hook_t)( - const wchar_t *src, - wchar_t *dest, - size_t *count); - -HRESULT path_hook_push(path_hook_t hook); -void path_hook_insert_hooks(HMODULE target); -int path_compare_w(const wchar_t *string1, const wchar_t *string2, size_t count); -BOOL path_transform_a(char **out, const char *src); -BOOL path_transform_w(wchar_t **out, const wchar_t *src); -BOOL path_transform_args_a(const char* str, char delimiter, char* buf, size_t size); -BOOL path_transform_args_w(const wchar_t* str, wchar_t delimiter, wchar_t* buf, size_t size); - -static inline bool path_is_separator_w(wchar_t c) -{ - return c == L'\\' || c == L'/'; -} +#ifdef __MINGW32__ +// MinGW already has this definition +#include +#else // This is only defined in the Windows Driver SDK, so we copy the definition in here typedef struct _REPARSE_DATA_BUFFER { @@ -53,4 +40,23 @@ typedef struct _REPARSE_DATA_BUFFER UCHAR DataBuffer[1]; } GenericReparseBuffer; }; -} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; \ No newline at end of file +} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; +#endif + +typedef HRESULT (*path_hook_t)( + const wchar_t *src, + wchar_t *dest, + size_t *count); + +HRESULT path_hook_push(path_hook_t hook); +void path_hook_insert_hooks(HMODULE target); +int path_compare_w(const wchar_t *string1, const wchar_t *string2, size_t count); +BOOL path_transform_a(char **out, const char *src); +BOOL path_transform_w(wchar_t **out, const wchar_t *src); +BOOL path_transform_args_a(const char* str, char delimiter, char* buf, size_t size); +BOOL path_transform_args_w(const wchar_t* str, wchar_t delimiter, wchar_t* buf, size_t size); + +static inline bool path_is_separator_w(wchar_t c) +{ + return c == L'\\' || c == L'/'; +} diff --git a/dist/apm3/launch.bat b/dist/apm3/launch.bat index 14e1dbe..060134d 100644 --- a/dist/apm3/launch.bat +++ b/dist/apm3/launch.bat @@ -21,8 +21,8 @@ inject -w -k apm3hook.dll hwvalue.exe modeltype if %ERRORLEVEL% == 5 goto BEGIN inject -w -k apm3hook.dll hwvalue.exe dipsw -set AMDAEMON_CONFIG=server.json -if %ERRORLEVEL% == 1 set AMDAEMON_CONFIG=client.json +set AMDAEMON_CONFIG=client.json +if %ERRORLEVEL% == 1 set AMDAEMON_CONFIG=server.json :BEGIN