mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[ADVAPI32]
- Properly stub some commonly used safer functions CORE-6942 #resolve svn path=/trunk/; revision=58868
This commit is contained in:
parent
03dfa33272
commit
17d42ae2a9
4 changed files with 192 additions and 25 deletions
|
@ -15,7 +15,6 @@ add_rpc_files(client
|
||||||
${REACTOS_SOURCE_DIR}/include/reactos/idl/lsa.idl
|
${REACTOS_SOURCE_DIR}/include/reactos/idl/lsa.idl
|
||||||
${REACTOS_SOURCE_DIR}/include/reactos/idl/svcctl.idl)
|
${REACTOS_SOURCE_DIR}/include/reactos/idl/svcctl.idl)
|
||||||
|
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
crypt/crypt.c
|
crypt/crypt.c
|
||||||
crypt/crypt_arc4.c
|
crypt/crypt_arc4.c
|
||||||
|
@ -38,6 +37,7 @@ list(APPEND SOURCE
|
||||||
sec/cred.c
|
sec/cred.c
|
||||||
sec/lsa.c
|
sec/lsa.c
|
||||||
sec/misc.c
|
sec/misc.c
|
||||||
|
sec/safer.c
|
||||||
sec/sec.c
|
sec/sec.c
|
||||||
sec/sid.c
|
sec/sid.c
|
||||||
sec/trustee.c
|
sec/trustee.c
|
||||||
|
|
|
@ -553,13 +553,13 @@
|
||||||
@ stdcall ReportEventA(long long long long ptr long long str ptr)
|
@ stdcall ReportEventA(long long long long ptr long long str ptr)
|
||||||
@ stdcall ReportEventW(long long long long ptr long long wstr ptr)
|
@ stdcall ReportEventW(long long long long ptr long long wstr ptr)
|
||||||
@ stdcall RevertToSelf()
|
@ stdcall RevertToSelf()
|
||||||
@ stub SaferCloseLevel
|
@ stdcall SaferCloseLevel(ptr)
|
||||||
@ stub SaferComputeTokenFromLevel
|
@ stdcall SaferComputeTokenFromLevel(ptr ptr ptr long ptr)
|
||||||
@ stdcall SaferCreateLevel(long long long ptr ptr)
|
@ stdcall SaferCreateLevel(long long long ptr ptr)
|
||||||
@ stub SaferGetLevelInformation
|
@ stub SaferGetLevelInformation
|
||||||
@ stdcall SaferGetPolicyInformation(long long long ptr ptr ptr)
|
@ stdcall SaferGetPolicyInformation(long long long ptr ptr ptr)
|
||||||
@ stub SaferIdentifyLevel
|
@ stdcall SaferIdentifyLevel(long ptr ptr ptr)
|
||||||
@ stub SaferRecordEventLogEntry
|
@ stdcall SaferRecordEventLogEntry(ptr wstr ptr)
|
||||||
@ stub SaferSetLevelInformation
|
@ stub SaferSetLevelInformation
|
||||||
@ stub SaferSetPolicyInformation
|
@ stub SaferSetPolicyInformation
|
||||||
@ stub SaferiChangeRegistryScope
|
@ stub SaferiChangeRegistryScope
|
||||||
|
|
|
@ -2279,26 +2279,6 @@ TreeResetNamedSecurityInfoA(LPSTR pObjectName,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* 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.@]
|
* QueryWindows31FilesMigration [ADVAPI32.@]
|
||||||
*
|
*
|
||||||
|
|
187
reactos/dll/win32/advapi32/sec/safer.c
Normal file
187
reactos/dll/win32/advapi32/sec/safer.c
Normal file
|
@ -0,0 +1,187 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS system libraries
|
||||||
|
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||||
|
* PURPOSE: Safer functions
|
||||||
|
* PROGRAMMER: Thomas Faber <thomas.faber@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 */
|
Loading…
Reference in a new issue