Author: tfaber
Date: Sat Apr 27 09:15:24 2013
New Revision: 58868
URL:
http://svn.reactos.org/svn/reactos?rev=58868&view=rev
Log:
[ADVAPI32]
- Properly stub some commonly used safer functions
CORE-6942 #resolve
Added:
trunk/reactos/dll/win32/advapi32/sec/safer.c (with props)
Modified:
trunk/reactos/dll/win32/advapi32/CMakeLists.txt
trunk/reactos/dll/win32/advapi32/advapi32.spec
trunk/reactos/dll/win32/advapi32/sec/misc.c
Modified: trunk/reactos/dll/win32/advapi32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] Sat Apr 27 09:15:24 2013
@@ -14,7 +14,6 @@
${REACTOS_SOURCE_DIR}/include/reactos/idl/eventlogrpc.idl
${REACTOS_SOURCE_DIR}/include/reactos/idl/lsa.idl
${REACTOS_SOURCE_DIR}/include/reactos/idl/svcctl.idl)
-
list(APPEND SOURCE
crypt/crypt.c
@@ -38,6 +37,7 @@
sec/cred.c
sec/lsa.c
sec/misc.c
+ sec/safer.c
sec/sec.c
sec/sid.c
sec/trustee.c
Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Sat Apr 27 09:15:24 2013
@@ -553,13 +553,13 @@
@ stdcall ReportEventA(long long long long ptr long long str ptr)
@ stdcall ReportEventW(long long long long ptr long long wstr ptr)
@ stdcall RevertToSelf()
-@ stub SaferCloseLevel
-@ stub SaferComputeTokenFromLevel
+@ stdcall SaferCloseLevel(ptr)
+@ stdcall SaferComputeTokenFromLevel(ptr ptr ptr long ptr)
@ stdcall SaferCreateLevel(long long long ptr ptr)
@ stub SaferGetLevelInformation
@ stdcall SaferGetPolicyInformation(long long long ptr ptr ptr)
-@ stub SaferIdentifyLevel
-@ stub SaferRecordEventLogEntry
+@ stdcall SaferIdentifyLevel(long ptr ptr ptr)
+@ stdcall SaferRecordEventLogEntry(ptr wstr ptr)
@ stub SaferSetLevelInformation
@ stub SaferSetPolicyInformation
@ stub SaferiChangeRegistryScope
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] Sat Apr 27 09:15:24 2013
@@ -2280,26 +2280,6 @@
}
/******************************************************************************
- * SaferCreateLevel [ADVAPI32.@]
- */
-BOOL WINAPI SaferCreateLevel(DWORD ScopeId, DWORD LevelId, DWORD OpenFlags,
- SAFER_LEVEL_HANDLE* LevelHandle, LPVOID lpReserved)
-{
- FIXME("(%u, %x, %u, %p, %p) stub\n", ScopeId, LevelId, OpenFlags,
LevelHandle, lpReserved);
- return FALSE;
-}
-
-/******************************************************************************
- * SaferGetPolicyInformation [ADVAPI32.@]
- */
-BOOL WINAPI SaferGetPolicyInformation(DWORD scope, SAFER_POLICY_INFO_CLASS class, DWORD
size,
- PVOID buffer, PDWORD required, LPVOID lpReserved)
-{
- FIXME("(%u %u %u %p %p %p) stub\n", scope, class, size, buffer, required,
lpReserved);
- return FALSE;
-}
-
-/******************************************************************************
* QueryWindows31FilesMigration [ADVAPI32.@]
*
* PARAMS
Added: trunk/reactos/dll/win32/advapi32/sec/safer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/saf…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/safer.c (added)
+++ trunk/reactos/dll/win32/advapi32/sec/safer.c [iso-8859-1] Sat Apr 27 09:15:24 2013
@@ -1,0 +1,187 @@
+/*
+ * PROJECT: ReactOS system libraries
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Safer functions
+ * PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <advapi32.h>
+WINE_DEFAULT_DEBUG_CHANNEL(advapi);
+
+
+/* FUNCTIONS *****************************************************************/
+
+/**********************************************************************
+ * SaferCreateLevel
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SaferCreateLevel(
+ _In_ DWORD dwScopeId,
+ _In_ DWORD dwLevelId,
+ _In_ DWORD OpenFlags,
+ _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle,
+ _Reserved_ PVOID pReserved)
+{
+ FIXME("(%lu, %lu, %lu, %p, %p) stub\n", dwScopeId, dwLevelId, OpenFlags,
pLevelHandle, pReserved);
+ *pLevelHandle = (SAFER_LEVEL_HANDLE)0x42;
+ return TRUE;
+}
+
+
+/**********************************************************************
+ * SaferIdentifyLevel
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SaferIdentifyLevel(
+ _In_ DWORD dwNumProperties,
+ _In_reads_opt_(dwNumProperties) PSAFER_CODE_PROPERTIES pCodeProperties,
+ _Outptr_ SAFER_LEVEL_HANDLE *pLevelHandle,
+ _Reserved_ PVOID pReserved)
+{
+ DWORD i;
+
+ if (pLevelHandle == NULL)
+ {
+ SetLastError(ERROR_NOACCESS);
+ return FALSE;
+ }
+
+ for (i = 0; i < dwNumProperties; i++)
+ {
+ if (pCodeProperties[i].cbSize != sizeof(SAFER_CODE_PROPERTIES_V1))
+ {
+ SetLastError(ERROR_BAD_LENGTH);
+ return FALSE;
+ }
+ }
+
+ FIXME("(%lu, %p, %p, %p) stub\n", dwNumProperties, pCodeProperties,
pLevelHandle, pReserved);
+
+ *pLevelHandle = (SAFER_LEVEL_HANDLE)0x42;
+ return TRUE;
+}
+
+
+/**********************************************************************
+ * SaferCloseLevel
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SaferCloseLevel(
+ _In_ SAFER_LEVEL_HANDLE hLevelHandle)
+{
+ FIXME("(%p) stub\n", hLevelHandle);
+ if (hLevelHandle != (SAFER_LEVEL_HANDLE)0x42)
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+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
+SaferSetLevelInformation(
+ _In_ SAFER_LEVEL_HANDLE LevelHandle,
+ _In_ SAFER_OBJECT_INFO_CLASS dwInfoType,
+ _In_reads_bytes_(dwInBufferSize) PVOID pQueryBuffer,
+ _In_ DWORD dwInBufferSize);
+
+
+/**********************************************************************
+ * SaferGetPolicyInformation
+ *
+ * @unimplemented
+ */
+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)
+{
+ FIXME("(%lu, %d, %lu, %p, %p, %p) stub\n", dwScopeId, SaferPolicyInfoClass,
InfoBufferSize, InfoBuffer, InfoBufferRetSize, pReserved);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+
+BOOL
+WINAPI
+SaferSetPolicyInformation(
+ _In_ DWORD dwScopeId,
+ _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
+ _In_ DWORD InfoBufferSize,
+ _In_reads_bytes_(InfoBufferSize) PVOID InfoBuffer,
+ _Reserved_ PVOID pReserved);
+
+
+/**********************************************************************
+ * SaferComputeTokenFromLevel
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SaferComputeTokenFromLevel(
+ _In_ SAFER_LEVEL_HANDLE LevelHandle,
+ _In_opt_ HANDLE InAccessToken,
+ _Out_ PHANDLE OutAccessToken,
+ _In_ DWORD dwFlags,
+ _Inout_opt_ PVOID pReserved)
+{
+ FIXME("(%p, %p, %p, 0x%lx, %p) stub\n", LevelHandle, InAccessToken,
OutAccessToken, dwFlags, pReserved);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+
+/**********************************************************************
+ * SaferRecordEventLogEntry
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+SaferRecordEventLogEntry(
+ _In_ SAFER_LEVEL_HANDLE hLevel,
+ _In_ PCWSTR szTargetPath,
+ _Reserved_ PVOID pReserved)
+{
+ FIXME("(%p, %s, %p) stub\n", hLevel, wine_dbgstr_w(szTargetPath),
pReserved);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+
+BOOL
+WINAPI
+SaferiIsExecutableFileType(
+ _In_ PCWSTR szFullPath,
+ _In_ BOOLEAN bFromShellExecute);
+
+/* EOF */
Propchange: trunk/reactos/dll/win32/advapi32/sec/safer.c
------------------------------------------------------------------------------
svn:eol-style = native