winreparse.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef Py_WINREPARSE_H
  2. #define Py_WINREPARSE_H
  3. #ifdef MS_WINDOWS
  4. #include <windows.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /* The following structure was copied from
  9. http://msdn.microsoft.com/en-us/library/ff552012.aspx as the required
  10. include km\ntifs.h isn't present in the Windows SDK (at least as included
  11. with Visual Studio Express). Use unique names to avoid conflicting with
  12. the structure as defined by Min GW. */
  13. typedef struct {
  14. ULONG ReparseTag;
  15. USHORT ReparseDataLength;
  16. USHORT Reserved;
  17. union {
  18. struct {
  19. USHORT SubstituteNameOffset;
  20. USHORT SubstituteNameLength;
  21. USHORT PrintNameOffset;
  22. USHORT PrintNameLength;
  23. ULONG Flags;
  24. WCHAR PathBuffer[1];
  25. } SymbolicLinkReparseBuffer;
  26. struct {
  27. USHORT SubstituteNameOffset;
  28. USHORT SubstituteNameLength;
  29. USHORT PrintNameOffset;
  30. USHORT PrintNameLength;
  31. WCHAR PathBuffer[1];
  32. } MountPointReparseBuffer;
  33. struct {
  34. UCHAR DataBuffer[1];
  35. } GenericReparseBuffer;
  36. };
  37. } _Py_REPARSE_DATA_BUFFER, *_Py_PREPARSE_DATA_BUFFER;
  38. #define _Py_REPARSE_DATA_BUFFER_HEADER_SIZE \
  39. FIELD_OFFSET(_Py_REPARSE_DATA_BUFFER, GenericReparseBuffer)
  40. #define _Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
  41. // Defined in WinBase.h in 'recent' versions of Windows 10 SDK
  42. #ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
  43. #define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x2
  44. #endif
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif /* MS_WINDOWS */
  49. #endif /* !Py_WINREPARSE_H */