ReactOS 0.4.15-dev-7660-g0086d05
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 */
21BOOL
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 */
41BOOL
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 */
78BOOL
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
93BOOL
96 _In_ SAFER_LEVEL_HANDLE LevelHandle,
98 _Out_writes_bytes_opt_(dwInBufferSize) PVOID pQueryBuffer,
99 _In_ DWORD dwInBufferSize,
100 _Out_ PDWORD pdwOutBufferSize);
101
102
103BOOL
104WINAPI
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 */
117BOOL
118WINAPI
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
133BOOL
134WINAPI
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 */
148BOOL
149WINAPI
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);
158 *OutAccessToken = (dwFlags & SAFER_TOKEN_NULL_IF_EQUAL) ? NULL : UlongToHandle(0xdeadf00d);
159 return TRUE;
160}
161
162
163/**********************************************************************
164 * SaferRecordEventLogEntry
165 *
166 * @unimplemented
167 */
168BOOL
169WINAPI
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
181BOOL
182WINAPI
184 _In_ PCWSTR szFullPath,
185 _In_ BOOLEAN bFromShellExecute);
186
187/* EOF */
unsigned char BOOLEAN
#define SaferIdentifyLevel(c, p, h, r)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define FIXME(fmt,...)
Definition: debug.h:111
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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 wine_dbgstr_w
Definition: kernel32.h:34
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Outptr_
Definition: ms_sal.h:427
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Out_
Definition: ms_sal.h:345
#define _In_reads_opt_(size)
Definition: ms_sal.h:320
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _Reserved_
Definition: ms_sal.h:295
#define _Out_writes_bytes_opt_(size)
Definition: ms_sal.h:351
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
DWORD * PDWORD
Definition: pedump.c:68
BOOL WINAPI SaferSetPolicyInformation(_In_ DWORD dwScopeId, _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass, _In_ DWORD InfoBufferSize, _In_reads_bytes_(InfoBufferSize) PVOID InfoBuffer, _Reserved_ PVOID pReserved)
BOOL WINAPI SaferiIsExecutableFileType(_In_ PCWSTR szFullPath, _In_ BOOLEAN bFromShellExecute)
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 SaferRecordEventLogEntry(_In_ SAFER_LEVEL_HANDLE hLevel, _In_ PCWSTR szTargetPath, _Reserved_ PVOID pReserved)
Definition: safer.c:170
BOOL WINAPI SaferCreateLevel(_In_ DWORD dwScopeId, _In_ DWORD dwLevelId, _In_ DWORD OpenFlags, _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle, _Reserved_ PVOID pReserved)
Definition: safer.c:23
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 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 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 SaferCloseLevel(_In_ SAFER_LEVEL_HANDLE hLevelHandle)
Definition: safer.c:80
const uint16_t * PCWSTR
Definition: typedefs.h:57
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
#define ERROR_BAD_LENGTH
Definition: winerror.h:127
#define ERROR_NOACCESS
Definition: winerror.h:578
enum _SAFER_OBJECT_INFO_CLASS SAFER_OBJECT_INFO_CLASS
enum _SAFER_POLICY_INFO_CLASS SAFER_POLICY_INFO_CLASS
#define SAFER_TOKEN_NULL_IF_EQUAL
Definition: winsafer.h:49