File indexing completed on 2025-01-18 10:04:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef OSD_WNT_HeaderFile
0016 #define OSD_WNT_HeaderFile
0017
0018 # ifndef STRICT
0019 # define STRICT
0020 # endif
0021
0022 # ifndef _INC_WINDOWS
0023 # include <windows.h>
0024 # endif
0025
0026 # ifdef __cplusplus
0027 extern "C" {
0028 # endif
0029
0030 enum DIR_RESPONSE { DIR_ABORT, DIR_RETRY, DIR_IGNORE };
0031
0032 #define FLAG_READ_PIPE 0x00000001
0033 #define FLAG_EOF 0x00000002
0034 #define FLAG_FILE 0x00000004
0035 #define FLAG_DIRECTORY 0x00000008
0036 #define FLAG_PIPE 0x00000010
0037 #define FLAG_SOCKET 0x00000020
0038 #define FLAG_NAMED_PIPE 0x00000040
0039 #define FLAG_DEVICE 0x00000080
0040 #define FLAG_TYPE 0x0000007C
0041
0042
0043
0044
0045
0046 #define LODWORD( a ) ( DWORD )( ( ( _int64 )( a ) ) & 0x00000000FFFFFFFF )
0047 #define HIDWORD( a ) ( DWORD )( ( ( _int64 )( a ) ) >> 32 )
0048
0049 typedef struct _file_ace {
0050
0051 ACE_HEADER header;
0052 DWORD dwMask;
0053 PSID pSID;
0054
0055 } FILE_ACE, *PFILE_ACE;
0056
0057 typedef void ( *MOVE_DIR_PROC ) ( LPCWSTR, LPCWSTR );
0058 typedef void ( *COPY_DIR_PROC ) ( LPCWSTR, LPCWSTR );
0059 typedef void ( *DELETE_DIR_PROC ) ( LPCWSTR );
0060
0061 typedef DIR_RESPONSE ( *RESPONSE_DIR_PROC ) ( LPCWSTR );
0062
0063 #define GET_SID( pACE ) ( ( PSID )( ( ( PBYTE )pACE ) + \
0064 sizeof ( ACE_HEADER ) + \
0065 sizeof ( DWORD ) \
0066 ) \
0067 )
0068
0069 #define GET_MSK( pACE ) ( ( PDWORD )( ( ( PBYTE )pACE ) + \
0070 sizeof ( ACE_HEADER ) \
0071 ) \
0072 )
0073
0074 PSECURITY_DESCRIPTOR AllocSD ( void );
0075 void FreeSD ( PSECURITY_DESCRIPTOR );
0076
0077 LPVOID GetTokenInformationEx ( HANDLE, TOKEN_INFORMATION_CLASS );
0078 void FreeTokenInformation ( LPVOID );
0079
0080 PSECURITY_DESCRIPTOR GetFileSecurityEx ( LPCWSTR, SECURITY_INFORMATION );
0081 void FreeFileSecurity ( PSECURITY_DESCRIPTOR );
0082
0083 PACL CreateAcl ( DWORD );
0084 void FreeAcl ( PACL );
0085
0086 BOOL PredefinedSid ( PSID );
0087 BOOL NtPredefinedSid ( PSID );
0088 PSID AdminSid ( void );
0089 PSID WorldSid ( void );
0090 PSID InteractiveSid ( void );
0091 PSID NetworkSid ( void );
0092 PSID LocalSid ( void );
0093 PSID DialupSid ( void );
0094 PSID BatchSid ( void );
0095 PSID CreatorOwnerSid ( void );
0096 PSID NullSid ( void );
0097 PSID NtSid ( void );
0098
0099 PVOID AllocAccessAllowedAce ( DWORD, BYTE, PSID );
0100 void FreeAce ( PVOID );
0101
0102 BOOL MoveDirectory ( LPCWSTR, LPCWSTR );
0103 BOOL CopyDirectory ( LPCWSTR, LPCWSTR );
0104
0105 void SetMoveDirectoryProc ( MOVE_DIR_PROC );
0106 void SetCopyDirectoryProc ( COPY_DIR_PROC );
0107 void SetResponseDirectoryProc ( RESPONSE_DIR_PROC );
0108
0109 # ifdef __cplusplus
0110 }
0111 # endif
0112
0113 #endif