ReactOS  0.4.14-dev-1338-g0d187f7
safer.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS system libraries
3  * LICENSE: GPLv2+ - See COPYING in the top level directory
4  * PURPOSE: Safer functions
5  * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6  */
7 
8 /* INCLUDES ******************************************************************/
9 
10 #include <advapi32.h>
12 
13 
14 /* FUNCTIONS *****************************************************************/
15 
16 /**********************************************************************
17  * SaferCreateLevel
18  *
19  * @unimplemented
20  */
21 BOOL
22 WINAPI
24  _In_ DWORD dwScopeId,
25  _In_ DWORD dwLevelId,
26  _In_ DWORD OpenFlags,
27  _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle,
28  _Reserved_ PVOID pReserved)
29 {
30  FIXME("(%lu, %lu, %lu, %p, %p) stub\n", dwScopeId, dwLevelId, OpenFlags, pLevelHandle, pReserved);
31  *pLevelHandle = (SAFER_LEVEL_HANDLE)0x42;
32  return TRUE;
33 }
34 
35 
36 /**********************************************************************
37  * SaferIdentifyLevel
38  *
39  * @unimplemented
40  */
41 BOOL
42 WINAPI
44  _In_ DWORD dwNumProperties,
45  _In_reads_opt_(dwNumProperties) PSAFER_CODE_PROPERTIES pCodeProperties,
46  _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle,
47  _Reserved_ PVOID pReserved)
48 {
49  DWORD i;
50 
51  if (pLevelHandle == NULL)
52  {
54  return FALSE;
55  }
56 
57  for (i = 0; i < dwNumProperties; i++)
58  {
59  if (pCodeProperties[i].cbSize != sizeof(SAFER_CODE_PROPERTIES_V1))
60  {
62  return FALSE;
63  }
64  }
65 
66  FIXME("(%lu, %p, %p, %p) stub\n", dwNumProperties, pCodeProperties, pLevelHandle, pReserved);
67 
68  *pLevelHandle = (SAFER_LEVEL_HANDLE)0x42;
69  return TRUE;
70 }
71 
72 
73 /**********************************************************************
74  * SaferCloseLevel
75  *
76  * @unimplemented
77  */
78 BOOL
79 WINAPI
81  _In_ SAFER_LEVEL_HANDLE hLevelHandle)
82 {
83  FIXME("(%p) stub\n", hLevelHandle);
84  if (hLevelHandle != (SAFER_LEVEL_HANDLE)0x42)
85  {
87  return FALSE;
88  }
89  return TRUE;
90 }
91 
92 
93 BOOL
94 WINAPI
96  _In_ SAFER_LEVEL_HANDLE LevelHandle,
97  _In_ SAFER_OBJECT_INFO_CLASS dwInfoType,
98  _Out_writes_bytes_opt_(dwInBufferSize) PVOID pQueryBuffer,
99  _In_ DWORD dwInBufferSize,
100  _Out_ PDWORD pdwOutBufferSize);
101 
102 
103 BOOL
104 WINAPI
106  _In_ SAFER_LEVEL_HANDLE LevelHandle,
107  _In_ SAFER_OBJECT_INFO_CLASS dwInfoType,
108  _In_reads_bytes_(dwInBufferSize) PVOID pQueryBuffer,
109  _In_ DWORD dwInBufferSize);
110 
111 
112 /**********************************************************************
113  * SaferGetPolicyInformation
114  *
115  * @unimplemented
116  */
117 BOOL
118 WINAPI
120  _In_ DWORD dwScopeId,
121  _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
122  _In_ DWORD InfoBufferSize,
123  _Out_writes_bytes_opt_(InfoBufferSize) PVOID InfoBuffer,
124  _Out_ PDWORD InfoBufferRetSize,
125  _Reserved_ PVOID pReserved)
126 {
127  FIXME("(%lu, %d, %lu, %p, %p, %p) stub\n", dwScopeId, SaferPolicyInfoClass, InfoBufferSize, InfoBuffer, InfoBufferRetSize, pReserved);
129  return FALSE;
130 }
131 
132 
133 BOOL
134 WINAPI
136  _In_ DWORD dwScopeId,
137  _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
138  _In_ DWORD InfoBufferSize,
139  _In_reads_bytes_(InfoBufferSize) PVOID InfoBuffer,
140  _Reserved_ PVOID pReserved);
141 
142 
143 /**********************************************************************
144  * SaferComputeTokenFromLevel
145  *
146  * @unimplemented
147  */
148 BOOL
149 WINAPI
151  _In_ SAFER_LEVEL_HANDLE LevelHandle,
152  _In_opt_ HANDLE InAccessToken,
153  _Out_ PHANDLE OutAccessToken,
155  _Inout_opt_ PVOID pReserved)
156 {
157  FIXME("(%p, %p, %p, 0x%lx, %p) stub\n", LevelHandle, InAccessToken, OutAccessToken, dwFlags, pReserved);
159  return FALSE;
160 }
161 
162 
163 /**********************************************************************
164  * SaferRecordEventLogEntry
165  *
166  * @unimplemented
167  */
168 BOOL
169 WINAPI
171  _In_ SAFER_LEVEL_HANDLE hLevel,
172  _In_ PCWSTR szTargetPath,
173  _Reserved_ PVOID pReserved)
174 {
175  FIXME("(%p, %s, %p) stub\n", hLevel, wine_dbgstr_w(szTargetPath), pReserved);
177  return FALSE;
178 }
179 
180 
181 BOOL
182 WINAPI
184  _In_ PCWSTR szFullPath,
185  _In_ BOOLEAN bFromShellExecute);
186 
187 /* EOF */
const uint16_t * PCWSTR
Definition: typedefs.h:56
BOOL WINAPI SaferIdentifyLevel(_In_ DWORD dwNumProperties, _In_reads_opt_(dwNumProperties) PSAFER_CODE_PROPERTIES pCodeProperties, _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle, _Reserved_ PVOID pReserved)
Definition: safer.c:43
#define TRUE
Definition: types.h:120
#define ERROR_BAD_LENGTH
Definition: winerror.h:127
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
BOOL WINAPI SaferComputeTokenFromLevel(_In_ SAFER_LEVEL_HANDLE LevelHandle, _In_opt_ HANDLE InAccessToken, _Out_ PHANDLE OutAccessToken, _In_ DWORD dwFlags, _Inout_opt_ PVOID pReserved)
Definition: safer.c:150
BOOL WINAPI SaferCreateLevel(_In_ DWORD dwScopeId, _In_ DWORD dwLevelId, _In_ DWORD OpenFlags, _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle, _Reserved_ PVOID pReserved)
Definition: safer.c:23
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define _Outptr_
Definition: no_sal2.h:396
#define _In_opt_
Definition: no_sal2.h:213
BOOL WINAPI SaferRecordEventLogEntry(_In_ SAFER_LEVEL_HANDLE hLevel, _In_ PCWSTR szTargetPath, _Reserved_ PVOID pReserved)
Definition: safer.c:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ERROR_NOACCESS
Definition: winerror.h:578
BOOL WINAPI SaferGetLevelInformation(_In_ SAFER_LEVEL_HANDLE LevelHandle, _In_ SAFER_OBJECT_INFO_CLASS dwInfoType, _Out_writes_bytes_opt_(dwInBufferSize) PVOID pQueryBuffer, _In_ DWORD dwInBufferSize, _Out_ PDWORD pdwOutBufferSize)
BOOL WINAPI SaferCloseLevel(_In_ SAFER_LEVEL_HANDLE hLevelHandle)
Definition: safer.c:80
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SaferiIsExecutableFileType(_In_ PCWSTR szFullPath, _In_ BOOLEAN bFromShellExecute)
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned char BOOLEAN
#define _Out_writes_bytes_opt_(a)
Definition: btrfs_drv.h:193
smooth NULL
Definition: ftsmooth.c:416
#define _Out_
Definition: no_sal2.h:323
enum _SAFER_POLICY_INFO_CLASS SAFER_POLICY_INFO_CLASS
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
#define _Reserved_
Definition: no_sal2.h:573
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
#define _In_
Definition: no_sal2.h:204
DWORD * PDWORD
Definition: pedump.c:68
#define _In_reads_opt_(size)
Definition: no_sal2.h:231
BOOL WINAPI SaferGetPolicyInformation(_In_ DWORD dwScopeId, _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass, _In_ DWORD InfoBufferSize, _Out_writes_bytes_opt_(InfoBufferSize) PVOID InfoBuffer, _Out_ PDWORD InfoBufferRetSize, _Reserved_ PVOID pReserved)
Definition: safer.c:119
BOOL WINAPI SaferSetLevelInformation(_In_ SAFER_LEVEL_HANDLE LevelHandle, _In_ SAFER_OBJECT_INFO_CLASS dwInfoType, _In_reads_bytes_(dwInBufferSize) PVOID pQueryBuffer, _In_ DWORD dwInBufferSize)
BOOL WINAPI SaferSetPolicyInformation(_In_ DWORD dwScopeId, _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass, _In_ DWORD InfoBufferSize, _In_reads_bytes_(InfoBufferSize) PVOID InfoBuffer, _Reserved_ PVOID pReserved)
WINE_DEFAULT_DEBUG_CHANNEL(advapi)
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
enum _SAFER_OBJECT_INFO_CLASS SAFER_OBJECT_INFO_CLASS
#define _Inout_opt_
Definition: no_sal2.h:258