mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 06:58:10 +00:00
[samlib]
- Add DDK header ntsam.h. - Add some client side stubs of the SAM RPC interface. svn path=/trunk/; revision=56646
This commit is contained in:
parent
5ba86d6b56
commit
91bf59e6d9
5 changed files with 139 additions and 7 deletions
|
@ -1,20 +1,27 @@
|
|||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
include_directories(
|
||||
${REACTOS_SOURCE_DIR}/include/reactos/idl
|
||||
${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
add_definitions(-D__WINESRC__)
|
||||
|
||||
set_rc_compiler()
|
||||
spec2def(samlib.dll samlib.spec ADD_IMPORTLIB)
|
||||
|
||||
add_rpc_files(client
|
||||
${REACTOS_SOURCE_DIR}/include/reactos/idl/sam.idl)
|
||||
|
||||
list(APPEND SOURCE
|
||||
dllmain.c
|
||||
samlib.c
|
||||
samlib.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/samlib_stubs.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/samlib.def)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/samlib.def
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sam_c.c)
|
||||
|
||||
add_library(samlib SHARED ${SOURCE})
|
||||
set_module_type(samlib win32dll)
|
||||
add_importlibs(samlib advapi32 msvcrt kernel32 ntdll)
|
||||
set_module_type(samlib win32dll UNICODE)
|
||||
add_importlibs(samlib rpcrt4 advapi32 msvcrt kernel32 ntdll)
|
||||
add_pch(samlib precomp.h)
|
||||
add_cd_file(TARGET samlib DESTINATION reactos/system32 FOR all)
|
||||
|
||||
|
|
|
@ -6,5 +6,8 @@
|
|||
#include <winerror.h>
|
||||
#define NTOS_MODE_USER
|
||||
#include <ndk/rtlfuncs.h>
|
||||
#include <ntsam.h>
|
||||
|
||||
#include "sam_c.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
|
|
@ -578,4 +578,95 @@ SamGetUserSid (PWSTR UserName,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void __RPC_FAR * __RPC_USER midl_user_allocate(SIZE_T len)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
||||
}
|
||||
|
||||
|
||||
void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, ptr);
|
||||
}
|
||||
|
||||
|
||||
handle_t __RPC_USER
|
||||
PSAMPR_SERVER_NAME_bind(PSAMPR_SERVER_NAME pszSystemName)
|
||||
{
|
||||
handle_t hBinding = NULL;
|
||||
LPWSTR pszStringBinding;
|
||||
RPC_STATUS status;
|
||||
|
||||
// TRACE("PSAMPR_SERVER_NAME_bind() called\n");
|
||||
|
||||
status = RpcStringBindingComposeW(NULL,
|
||||
L"ncacn_np",
|
||||
pszSystemName,
|
||||
L"\\pipe\\samr",
|
||||
NULL,
|
||||
&pszStringBinding);
|
||||
if (status)
|
||||
{
|
||||
// TRACE("RpcStringBindingCompose returned 0x%x\n", status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Set the binding handle that will be used to bind to the server. */
|
||||
status = RpcBindingFromStringBindingW(pszStringBinding,
|
||||
&hBinding);
|
||||
if (status)
|
||||
{
|
||||
// TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
|
||||
}
|
||||
|
||||
status = RpcStringFreeW(&pszStringBinding);
|
||||
if (status)
|
||||
{
|
||||
// TRACE("RpcStringFree returned 0x%x\n", status);
|
||||
}
|
||||
|
||||
return hBinding;
|
||||
}
|
||||
|
||||
|
||||
void __RPC_USER
|
||||
PSAMPR_SERVER_NAME_unbind(PSAMPR_SERVER_NAME pszSystemName,
|
||||
handle_t hBinding)
|
||||
{
|
||||
RPC_STATUS status;
|
||||
|
||||
// TRACE("PSAMPR_SERVER_NAME_unbind() called\n");
|
||||
|
||||
status = RpcBindingFree(&hBinding);
|
||||
if (status)
|
||||
{
|
||||
// TRACE("RpcBindingFree returned 0x%x\n", status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamCloseHandle(IN SAM_HANDLE SamHandle)
|
||||
{
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamConnect(IN OUT PUNICODE_STRING ServerName,
|
||||
OUT PSAM_HANDLE ServerHandle,
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
IN POBJECT_ATTRIBUTES ObjectAttributes)
|
||||
{
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamShutdownSamServer(IN SAM_HANDLE ServerHandle)
|
||||
{
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
@ stub SamChangePasswordUser2
|
||||
@ stub SamChangePasswordUser3
|
||||
@ stub SamChangePasswordUser
|
||||
@ stub SamCloseHandle
|
||||
@ stub SamConnect
|
||||
@ stdcall SamCloseHandle(ptr)
|
||||
@ stdcall SamConnect(ptr ptr long ptr)
|
||||
@ stub SamConnectWithCreds
|
||||
@ stub SamCreateAliasInDomain
|
||||
@ stub SamCreateGroupInDomain
|
||||
|
@ -49,7 +49,7 @@
|
|||
@ stub SamSetInformationUser
|
||||
@ stub SamSetMemberAttributesOfGroup
|
||||
@ stub SamSetSecurityObject
|
||||
@ stub SamShutdownSamServer
|
||||
@ stdcall SamShutdownSamServer(ptr)
|
||||
@ stub SamTestPrivateFunctionsDomain
|
||||
@ stub SamTestPrivateFunctionsUser
|
||||
@ stub SamiChangeKeys
|
||||
|
|
31
reactos/include/ddk/ntsam.h
Normal file
31
reactos/include/ddk/ntsam.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
#ifndef _NTSAM_
|
||||
#define _NTSAM_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef PVOID SAM_HANDLE, *PSAM_HANDLE;
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamCloseHandle(IN SAM_HANDLE SamHandle);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamConnect(IN OUT PUNICODE_STRING ServerName,
|
||||
OUT PSAM_HANDLE ServerHandle,
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
IN POBJECT_ATTRIBUTES ObjectAttributes);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamShutdownSamServer(IN SAM_HANDLE ServerHandle);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _NTSAM_ */
|
Loading…
Reference in a new issue