Author: ekohl
Date: Sun May 20 20:33:16 2012
New Revision: 56646
URL:
http://svn.reactos.org/svn/reactos?rev=56646&view=rev
Log:
[samlib]
- Add DDK header ntsam.h.
- Add some client side stubs of the SAM RPC interface.
Added:
trunk/reactos/include/ddk/ntsam.h (with props)
Modified:
trunk/reactos/dll/win32/samlib/CMakeLists.txt
trunk/reactos/dll/win32/samlib/precomp.h
trunk/reactos/dll/win32/samlib/samlib.c
trunk/reactos/dll/win32/samlib/samlib.spec
Modified: trunk/reactos/dll/win32/samlib/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/CMakeList…
==============================================================================
--- trunk/reactos/dll/win32/samlib/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/CMakeLists.txt [iso-8859-1] Sun May 20 20:33:16 2012
@@ -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)
Modified: trunk/reactos/dll/win32/samlib/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/precomp.h…
==============================================================================
--- trunk/reactos/dll/win32/samlib/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/precomp.h [iso-8859-1] Sun May 20 20:33:16 2012
@@ -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"
Modified: trunk/reactos/dll/win32/samlib/samlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.c?…
==============================================================================
--- trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] Sun May 20 20:33:16 2012
@@ -578,4 +578,95 @@
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 */
Modified: trunk/reactos/dll/win32/samlib/samlib.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.sp…
==============================================================================
--- trunk/reactos/dll/win32/samlib/samlib.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/samlib.spec [iso-8859-1] Sun May 20 20:33:16 2012
@@ -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
Added: trunk/reactos/include/ddk/ntsam.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntsam.h?rev=56…
==============================================================================
--- trunk/reactos/include/ddk/ntsam.h (added)
+++ trunk/reactos/include/ddk/ntsam.h [iso-8859-1] Sun May 20 20:33:16 2012
@@ -1,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_ */
Propchange: trunk/reactos/include/ddk/ntsam.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/include/ddk/ntsam.h
------------------------------------------------------------------------------
svn:keywords = author date id revision