diff --git a/common/hooklib/path.c b/common/hooklib/path.c index 3e43fed..e3e4ae5 100644 --- a/common/hooklib/path.c +++ b/common/hooklib/path.c @@ -2,7 +2,6 @@ #include #include -#include #include #include #include @@ -12,7 +11,6 @@ #include "hooklib/path.h" -#include #include #include @@ -1810,7 +1808,7 @@ static BOOL WINAPI hook_DeviceIoControl( return FALSE; } - REPARSE_DATA_BUFFER* mount = lpInBuffer; + REPARSE_DATA_BUFFER* mount = (REPARSE_DATA_BUFFER*)lpInBuffer; wchar_t *trans; wchar_t *src; diff --git a/common/hooklib/path.h b/common/hooklib/path.h index aca9356..3508d0b 100644 --- a/common/hooklib/path.h +++ b/common/hooklib/path.h @@ -22,3 +22,35 @@ static inline bool path_is_separator_w(wchar_t c) { return c == L'\\' || c == L'/'; } + +// This is only defined in the Windows Driver SDK, so we copy the definition in here +typedef struct _REPARSE_DATA_BUFFER +{ + ULONG ReparseTag; + USHORT ReparseDataLength; + USHORT Reserved; + union + { + struct + { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + ULONG Flags; + WCHAR PathBuffer[1]; + } SymbolicLinkReparseBuffer; + struct + { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + WCHAR PathBuffer[1]; + } MountPointReparseBuffer; + struct + { + UCHAR DataBuffer[1]; + } GenericReparseBuffer; + }; +} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; \ No newline at end of file