rsxntwin.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
  3. See the accompanying file LICENSE, version 2000-Apr-09 or later
  4. (the contents of which are also included in zip.h) for terms of use.
  5. If, for some reason, all these files are missing, the Info-ZIP license
  6. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  7. */
  8. /* rsxntwin.h
  9. *
  10. * fills some gaps in the rsxnt 1.3 win32 header files (<windows.h>) that are
  11. * required for compiling Info-ZIP sources for Win NT / Win 95
  12. */
  13. #ifdef __RSXNT__
  14. #if !defined (_RSXNTWIN_H)
  15. #define _RSXNTWIN_H
  16. #ifdef TFUNCT /* TFUNCT is undefined when MSSDK headers are used */
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define PASCAL __stdcall
  21. #define ANYSIZE_ARRAY 1
  22. #ifndef TIME_ZONE_ID_UNKNOWN
  23. # define TIME_ZONE_ID_UNKNOWN 0
  24. #endif
  25. #ifndef TIME_ZONE_ID_INVALID
  26. # define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL
  27. #endif
  28. #define FILE_ATTRIBUTE_HIDDEN 0x00000002
  29. #define FILE_ATTRIBUTE_SYSTEM 0x00000004
  30. #define FILE_SHARE_DELETE 0x00000004
  31. #define FILE_PERSISTENT_ACLS 0x00000008
  32. #define HFILE_ERROR ((HFILE)-1)
  33. #define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS
  34. BOOL WINAPI DosDateTimeToFileTime(WORD, WORD, LPFILETIME);
  35. #ifndef SetVolumeLabel
  36. #define SetVolumeLabel TFUNCT(SetVolumeLabel)
  37. #endif
  38. BOOL WINAPI SetVolumeLabel(LPCTSTR, LPCTSTR);
  39. #ifndef GetDriveType
  40. #define GetDriveType TFUNCT(GetDriveType)
  41. #endif
  42. DWORD GetDriveType(LPCTSTR);
  43. #define DRIVE_UNKNOWN 0
  44. #define DRIVE_REMOVABLE 2
  45. #define DRIVE_FIXED 3
  46. #define DRIVE_REMOTE 4
  47. #define DRIVE_CDROM 5
  48. #define DRIVE_RAMDISK 6
  49. #ifndef SearchPath
  50. #define SearchPath TFUNCT(SearchPath)
  51. #endif
  52. BOOL WINAPI SearchPath(LPCTSTR, LPCTSTR, LPCTSTR, UINT, LPTSTR, LPTSTR *);
  53. #define ERROR_SUCCESS 0
  54. #define ERROR_INSUFFICIENT_BUFFER 122
  55. LONG WINAPI InterlockedExchange(LPLONG, LONG);
  56. #define ACCESS_SYSTEM_SECURITY 0x01000000L
  57. typedef PVOID PSECURITY_DESCRIPTOR;
  58. typedef PVOID PSID;
  59. typedef struct _ACL {
  60. BYTE AclRevision;
  61. BYTE Sbz1;
  62. WORD AclSize;
  63. WORD AceCount;
  64. WORD Sbz2;
  65. } ACL;
  66. typedef ACL *PACL;
  67. typedef struct _LUID {
  68. DWORD LowPart;
  69. LONG HighPart;
  70. } LUID, *PLUID;
  71. typedef struct _LUID_AND_ATTRIBUTES {
  72. LUID Luid;
  73. DWORD Attributes;
  74. } LUID_AND_ATTRIBUTES, * PLUID_AND_ATTRIBUTES;
  75. typedef struct _TOKEN_PRIVILEGES {
  76. DWORD PrivilegeCount;
  77. LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
  78. } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;
  79. #define TOKEN_QUERY 0x0008
  80. #define TOKEN_ADJUST_PRIVILEGES 0x0020
  81. BOOL WINAPI OpenProcessToken(HANDLE, DWORD, PHANDLE);
  82. BOOL WINAPI AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD,
  83. PTOKEN_PRIVILEGES, PDWORD);
  84. #ifndef LookupPrivilegeValue
  85. #define LookupPrivilegeValue TFUNCT(LookupPrivilegeValue)
  86. #endif
  87. BOOL WINAPI LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID);
  88. typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
  89. #define OWNER_SECURITY_INFORMATION 0x00000001L
  90. #define GROUP_SECURITY_INFORMATION 0x00000002L
  91. #define DACL_SECURITY_INFORMATION 0x00000004L
  92. #define SACL_SECURITY_INFORMATION 0x00000008L
  93. typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
  94. #define SE_DACL_PRESENT 0x0004
  95. #define SE_SACL_PRESENT 0x0010
  96. #define SE_PRIVILEGE_ENABLED 0x00000002L
  97. #define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
  98. #define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
  99. #define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
  100. BOOL WINAPI GetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION,
  101. PSECURITY_DESCRIPTOR, DWORD, LPDWORD);
  102. BOOL WINAPI SetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION,
  103. PSECURITY_DESCRIPTOR);
  104. BOOL WINAPI IsValidSid(PSID);
  105. BOOL WINAPI IsValidAcl(PACL);
  106. BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR);
  107. BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
  108. DWORD WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
  109. BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,
  110. PSECURITY_DESCRIPTOR_CONTROL, LPDWORD);
  111. BOOL WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,
  112. SECURITY_DESCRIPTOR_CONTROL, SECURITY_DESCRIPTOR_CONTROL);
  113. BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,
  114. LPBOOL, PACL *, LPBOOL);
  115. BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL);
  116. BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,
  117. LPBOOL, PACL *, LPBOOL);
  118. BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL);
  119. BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID *, LPBOOL);
  120. BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID, BOOL);
  121. BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID *, LPBOOL);
  122. BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID, BOOL);
  123. VOID WINAPI InitializeCriticalSection();
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127. #endif /* TFUNCT */
  128. #endif /* !defined (_RSXNTWIN_H) */
  129. #endif /* __RSXNT__ */