Eliminate compiler warnings on VC++ 14 and CLang.
[occt.git] / src / OSD / OSD_WNT_1.hxx
CommitLineData
b311480e 1// Copyright (c) 1998-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
7fd59977 15#ifndef __OSD_WNT_H
16# define __OSD_WNT_H
17
18# ifndef STRICT
19# define STRICT
20# endif /* STRICT */
21
22# ifndef _INC_WINDOWS
23# include <windows.h>
24# endif /* _INC_WINDOWS */
25
7fd59977 26# ifndef OSDAPI
27# if !defined(HAVE_NO_DLL)
28# ifdef __OSD_DLL
29# define OSDAPI __declspec( dllexport )
30# else
31# define OSDAPI __declspec( dllimport )
32# endif /* OSD_DLL */
33# else
34# define OSDAPI
35# endif
36# endif /* OSDAPI */
37
38#if defined(__CYGWIN32__) || defined(__MINGW32__)
39#define _TINT int
40#endif
41
42# ifdef __cplusplus
43extern "C" {
44# endif /* __cplusplus */
45
46enum DIR_RESPONSE { DIR_ABORT, DIR_RETRY, DIR_IGNORE };
47
7fd59977 48#define FLAG_READ_PIPE 0x00000001
49#define FLAG_EOF 0x00000002
50#define FLAG_FILE 0x00000004
51#define FLAG_DIRECTORY 0x00000008
52#define FLAG_PIPE 0x00000010
53#define FLAG_SOCKET 0x00000020
54#define FLAG_NAMED_PIPE 0x00000040
55#define FLAG_DEVICE 0x00000080
56#define FLAG_TYPE 0x0000007C
57
58// 2 macros modified for VisualAge
59//#define LODWORD( a ) ( DWORD )( ( ( DWORDLONG )( a ) ) & 0x00000000FFFFFFFF )
60//#define HIDWORD( a ) ( DWORD )( ( ( DWORDLONG )( a ) ) >> 32 )
61
62#define LODWORD( a ) ( DWORD )( ( ( _int64 )( a ) ) & 0x00000000FFFFFFFF )
63#define HIDWORD( a ) ( DWORD )( ( ( _int64 )( a ) ) >> 32 )
64
7fd59977 65typedef struct _file_ace {
66
67 ACE_HEADER header;
68 DWORD dwMask;
69 PSID pSID;
70
71 } FILE_ACE, *PFILE_ACE;
72
d9ff84e8 73typedef void ( *MOVE_DIR_PROC ) ( LPCWSTR, LPCWSTR );
74typedef void ( *COPY_DIR_PROC ) ( LPCWSTR, LPCWSTR );
75typedef void ( *DELETE_DIR_PROC ) ( LPCWSTR );
7fd59977 76
d9ff84e8 77typedef DIR_RESPONSE ( *RESPONSE_DIR_PROC ) ( LPCWSTR );
7fd59977 78
79#define GET_SID( pACE ) ( ( PSID )( ( ( PBYTE )pACE ) + \
80 sizeof ( ACE_HEADER ) + \
81 sizeof ( DWORD ) \
82 ) \
83 )
84
85#define GET_MSK( pACE ) ( ( PDWORD )( ( ( PBYTE )pACE ) + \
86 sizeof ( ACE_HEADER ) \
87 ) \
88 )
89
90PSECURITY_DESCRIPTOR OSDAPI AllocSD ( void );
91void OSDAPI FreeSD ( PSECURITY_DESCRIPTOR );
92
93LPVOID OSDAPI GetTokenInformationEx ( HANDLE, TOKEN_INFORMATION_CLASS );
94void OSDAPI FreeTokenInformation ( LPVOID );
95
d9ff84e8 96PSECURITY_DESCRIPTOR OSDAPI GetFileSecurityEx ( LPCWSTR, SECURITY_INFORMATION );
7fd59977 97void OSDAPI FreeFileSecurity ( PSECURITY_DESCRIPTOR );
98
7fd59977 99PACL OSDAPI CreateAcl ( DWORD );
100void OSDAPI FreeAcl ( PACL );
101
102BOOL OSDAPI PredefinedSid ( PSID );
103BOOL OSDAPI NtPredefinedSid ( PSID );
104PSID OSDAPI AdminSid ( void );
105PSID OSDAPI WorldSid ( void );
106PSID OSDAPI InteractiveSid ( void );
107PSID OSDAPI NetworkSid ( void );
108PSID OSDAPI LocalSid ( void );
109PSID OSDAPI DialupSid ( void );
110PSID OSDAPI BatchSid ( void );
111PSID OSDAPI CreatorOwnerSid ( void );
112PSID OSDAPI NullSid ( void );
113PSID OSDAPI NtSid ( void );
114
7fd59977 115PVOID OSDAPI AllocAccessAllowedAce ( DWORD, BYTE, PSID );
116void OSDAPI FreeAce ( PVOID );
117
d9ff84e8 118BOOL OSDAPI MoveDirectory ( LPCWSTR, LPCWSTR );
119BOOL OSDAPI CopyDirectory ( LPCWSTR, LPCWSTR );
7fd59977 120
7fd59977 121void OSDAPI SetMoveDirectoryProc ( MOVE_DIR_PROC );
122void OSDAPI SetCopyDirectoryProc ( COPY_DIR_PROC );
123void OSDAPI SetResponseDirectoryProc ( RESPONSE_DIR_PROC );
124
7fd59977 125# ifdef __cplusplus
126}
127# endif /* __cplusplus */
128
129#endif /* __OSD_WNT_H */