ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
12 participants
227 discussions
Start a n
N
ew thread
[ion] 56651: [KERNEL32]: Formatting cleanups and annotations. [KERNEL32]: Simplify QueueWorkItem since the trampoline is in Rtl. [KERNEL32]: Add SxS support to QueueUserApc. [KERNEL32]: Add some ex...
by ion@svn.reactos.org
Author: ion Date: Wed May 23 17:35:25 2012 New Revision: 56651 URL:
http://svn.reactos.org/svn/reactos?rev=56651&view=rev
Log: [KERNEL32]: Formatting cleanups and annotations. [KERNEL32]: Simplify QueueWorkItem since the trampoline is in Rtl. [KERNEL32]: Add SxS support to QueueUserApc. [KERNEL32]: Add some extra sanity checks/assertions in certain places. Modified: trunk/reactos/dll/win32/kernel32/client/thread.c Modified: trunk/reactos/dll/win32/kernel32/client/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/thread.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/thread.c [iso-8859-1] Wed May 23 17:35:25 2012 @@ -8,15 +8,13 @@ * */ -/* INCLUDES ******************************************************************/ +/* INCLUDES *******************************************************************/ #include <k32.h> #define NDEBUG #include <debug.h> -/* FIXME: NDK */ -#define HIGH_PRIORITY 31 #define SXS_SUPPORT_FIXME typedef NTSTATUS (NTAPI *PCSR_CREATE_REMOTE_THREAD)(IN HANDLE ThreadHandle, IN PCLIENT_ID ClientId); @@ -26,14 +24,15 @@ BasepNotifyCsrOfThread(IN HANDLE ThreadHandle, IN PCLIENT_ID ClientId); -/* FUNCTIONS *****************************************************************/ +/* FUNCTIONS ******************************************************************/ + static LONG BaseThreadExceptionFilter(EXCEPTION_POINTERS * ExceptionInfo) { LONG ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER; LPTOP_LEVEL_EXCEPTION_FILTER RealFilter; RealFilter = RtlDecodePointer(GlobalTopLevelExceptionFilter); - + if (RealFilter != NULL) { _SEH2_TRY @@ -53,8 +52,8 @@ __declspec(noreturn) VOID WINAPI -BaseThreadStartup(LPTHREAD_START_ROUTINE lpStartAddress, - LPVOID lpParameter) +BaseThreadStartup(IN LPTHREAD_START_ROUTINE lpStartAddress, + IN LPVOID lpParameter) { /* Attempt to call the Thread Start Address */ _SEH2_TRY @@ -86,17 +85,58 @@ _SEH2_END; } +VOID +NTAPI +BaseDispatchApc(IN PAPCFUNC ApcRoutine, + IN PVOID Data, + IN PACTIVATION_CONTEXT ActivationContext) +{ + RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME ActivationFrame; + + /* Setup the activation context */ + ActivationFrame.Size = sizeof(ActivationFrame); + ActivationFrame.Format = RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER; + + /* Check if caller wanted one */ + if (ActivationContext == INVALID_ACTIVATION_CONTEXT) + { + /* Do the APC directly */ + ApcRoutine((ULONG_PTR)Data); + return; + } + + /* Then activate it */ + RtlActivateActivationContextUnsafeFast(&ActivationFrame, ActivationContext); + + /* Call the routine under SEH */ + _SEH2_TRY + { + ApcRoutine((ULONG_PTR)Data); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + + } + _SEH2_END; + + /* Now de-activate and release the activation context */ + RtlDeactivateActivationContextUnsafeFast(&ActivationFrame); + RtlReleaseActivationContext(ActivationContext); +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + /* * @implemented */ HANDLE WINAPI -CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, - DWORD dwStackSize, - LPTHREAD_START_ROUTINE lpStartAddress, - LPVOID lpParameter, - DWORD dwCreationFlags, - LPDWORD lpThreadId) +CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, + IN DWORD dwStackSize, + IN LPTHREAD_START_ROUTINE lpStartAddress, + IN LPVOID lpParameter, + IN DWORD dwCreationFlags, + OUT LPDWORD lpThreadId) { /* Act as if we're going to create a remote thread in ourselves */ return CreateRemoteThread(NtCurrentProcess(), @@ -251,7 +291,7 @@ if (hProcess != NtCurrentProcess()) { PCSR_CREATE_REMOTE_THREAD CsrCreateRemoteThread; - + /* Get the direct CSRSRV export */ CsrCreateRemoteThread = (PCSR_CREATE_REMOTE_THREAD) GetProcAddress(GetModuleHandleA("csrsrv"), @@ -263,7 +303,7 @@ } } } - + if (!NT_SUCCESS(Status)) { ASSERT(FALSE); @@ -287,10 +327,15 @@ */ VOID WINAPI -ExitThread(DWORD uExitCode) +ExitThread(IN DWORD uExitCode) { NTSTATUS Status; ULONG LastThread; + PRTL_CRITICAL_SECTION LoaderLock; + + /* Make sure loader lock isn't held */ + LoaderLock = NtCurrentPeb()->LoaderLock; + if (LoaderLock) ASSERT(NtCurrentTeb()->ClientId.UniqueThread != LoaderLock->OwningThread); /* * Terminate process if this is the last thread @@ -301,11 +346,7 @@ &LastThread, sizeof(LastThread), NULL); - if (NT_SUCCESS(Status) && LastThread) - { - /* Exit the Process */ - ExitProcess(uExitCode); - } + if ((NT_SUCCESS(Status)) && (LastThread)) ExitProcess(uExitCode); /* Notify DLLs and TLS Callbacks of termination */ LdrShutdownThread(); @@ -316,7 +357,7 @@ /* We should never reach this place */ DPRINT1("It should not happen\n"); - while (TRUE) ; + while (TRUE); } /* @@ -324,14 +365,14 @@ */ HANDLE WINAPI -OpenThread(DWORD dwDesiredAccess, - BOOL bInheritHandle, - DWORD dwThreadId) +OpenThread(IN DWORD dwDesiredAccess, + IN BOOL bInheritHandle, + IN DWORD dwThreadId) { NTSTATUS Status; HANDLE ThreadHandle; OBJECT_ATTRIBUTES ObjectAttributes; - CLIENT_ID ClientId ; + CLIENT_ID ClientId; ClientId.UniqueProcess = 0; ClientId.UniqueThread = ULongToHandle(dwThreadId); @@ -390,11 +431,11 @@ */ BOOL NTAPI -GetThreadTimes(HANDLE hThread, - LPFILETIME lpCreationTime, - LPFILETIME lpExitTime, - LPFILETIME lpKernelTime, - LPFILETIME lpUserTime) +GetThreadTimes(IN HANDLE hThread, + OUT LPFILETIME lpCreationTime, + OUT LPFILETIME lpExitTime, + OUT LPFILETIME lpKernelTime, + OUT LPFILETIME lpUserTime) { KERNEL_USER_TIMES KernelUserTimes; NTSTATUS Status; @@ -407,7 +448,7 @@ if (!NT_SUCCESS(Status)) { BaseSetLastNTError(Status); - return(FALSE); + return FALSE; } *lpCreationTime = *(LPFILETIME)&KernelUserTimes.CreateTime; @@ -422,8 +463,8 @@ */ BOOL WINAPI -GetThreadContext(HANDLE hThread, - LPCONTEXT lpContext) +GetThreadContext(IN HANDLE hThread, + OUT LPCONTEXT lpContext) { NTSTATUS Status; @@ -442,8 +483,8 @@ */ BOOL WINAPI -SetThreadContext(HANDLE hThread, - CONST CONTEXT *lpContext) +SetThreadContext(IN HANDLE hThread, + IN CONST CONTEXT *lpContext) { NTSTATUS Status; @@ -462,8 +503,8 @@ */ BOOL WINAPI -GetExitCodeThread(HANDLE hThread, - LPDWORD lpExitCode) +GetExitCodeThread(IN HANDLE hThread, + OUT LPDWORD lpExitCode) { THREAD_BASIC_INFORMATION ThreadBasic; NTSTATUS Status; @@ -476,7 +517,7 @@ if (!NT_SUCCESS(Status)) { BaseSetLastNTError(Status); - return(FALSE); + return FALSE; } *lpExitCode = ThreadBasic.ExitStatus; @@ -488,7 +529,7 @@ */ DWORD WINAPI -ResumeThread(HANDLE hThread) +ResumeThread(IN HANDLE hThread) { ULONG PreviousResumeCount; NTSTATUS Status; @@ -508,24 +549,49 @@ */ BOOL WINAPI -TerminateThread(HANDLE hThread, - DWORD dwExitCode) -{ - NTSTATUS Status; - +TerminateThread(IN HANDLE hThread, + IN DWORD dwExitCode) +{ + NTSTATUS Status; + PRTL_CRITICAL_SECTION LoaderLock; + THREAD_BASIC_INFORMATION ThreadInfo; + + /* Check for invalid thread handle */ if (!hThread) { + /* Fail if one was passed */ SetLastError(ERROR_INVALID_HANDLE); return FALSE; } + /* Get the loader lock */ + LoaderLock = NtCurrentPeb()->LoaderLock; + if (LoaderLock) + { + /* Get our TID */ + Status = NtQueryInformationThread(hThread, + ThreadBasicInformation, + &ThreadInfo, + sizeof(ThreadInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + /* Assert that we don't hold the loader lock */ + ASSERT(NtCurrentTeb()->ClientId.UniqueThread != ThreadInfo.ClientId.UniqueThread); + ASSERT(NtCurrentTeb()->ClientId.UniqueThread != LoaderLock->OwningThread); + } + } + + /* Now terminate the thread */ Status = NtTerminateThread(hThread, dwExitCode); if (!NT_SUCCESS(Status)) { - BaseSetLastNTError(Status); - return FALSE; - } - + /* Fail */ + BaseSetLastNTError(Status); + return FALSE; + } + + /* All done */ return TRUE; } @@ -534,7 +600,7 @@ */ DWORD WINAPI -SuspendThread(HANDLE hThread) +SuspendThread(IN HANDLE hThread) { ULONG PreviousSuspendCount; NTSTATUS Status; @@ -554,8 +620,8 @@ */ DWORD_PTR WINAPI -SetThreadAffinityMask(HANDLE hThread, - DWORD_PTR dwThreadAffinityMask) +SetThreadAffinityMask(IN HANDLE hThread, + IN DWORD_PTR dwThreadAffinityMask) { THREAD_BASIC_INFORMATION ThreadBasic; KAFFINITY AffinityMask; @@ -592,8 +658,8 @@ */ BOOL WINAPI -SetThreadPriority(HANDLE hThread, - int nPriority) +SetThreadPriority(IN HANDLE hThread, + IN int nPriority) { LONG Prio = nPriority; NTSTATUS Status; @@ -601,10 +667,12 @@ /* Check if values forcing saturation should be used */ if (Prio == THREAD_PRIORITY_TIME_CRITICAL) { + /* This is 16 */ Prio = (HIGH_PRIORITY + 1) / 2; } else if (Prio == THREAD_PRIORITY_IDLE) { + /* This is -16 */ Prio = -((HIGH_PRIORITY + 1) / 2); } @@ -629,7 +697,7 @@ */ int WINAPI -GetThreadPriority(HANDLE hThread) +GetThreadPriority(IN HANDLE hThread) { THREAD_BASIC_INFORMATION ThreadBasic; NTSTATUS Status; @@ -700,7 +768,7 @@ ULONG PriorityBoost; NTSTATUS Status; - PriorityBoost = (ULONG)bDisablePriorityBoost; + PriorityBoost = bDisablePriorityBoost != FALSE; Status = NtSetInformationThread(hThread, ThreadPriorityBoost, @@ -756,8 +824,8 @@ */ DWORD WINAPI -SetThreadIdealProcessor(HANDLE hThread, - DWORD dwIdealProcessor) +SetThreadIdealProcessor(IN HANDLE hThread, + IN DWORD dwIdealProcessor) { NTSTATUS Status; @@ -777,197 +845,171 @@ /* * @implemented */ -DWORD WINAPI -GetProcessIdOfThread(HANDLE Thread) -{ - THREAD_BASIC_INFORMATION ThreadBasic; - NTSTATUS Status; - - Status = NtQueryInformationThread(Thread, - ThreadBasicInformation, - &ThreadBasic, - sizeof(THREAD_BASIC_INFORMATION), - NULL); - if(!NT_SUCCESS(Status)) - { +DWORD +WINAPI +GetProcessIdOfThread(IN HANDLE Thread) +{ + THREAD_BASIC_INFORMATION ThreadBasic; + NTSTATUS Status; + + Status = NtQueryInformationThread(Thread, + ThreadBasicInformation, + &ThreadBasic, + sizeof(THREAD_BASIC_INFORMATION), + NULL); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return 0; + } + + return HandleToUlong(ThreadBasic.ClientId.UniqueProcess); +} + +/* + * @implemented + */ +DWORD +WINAPI +GetThreadId(IN HANDLE Thread) +{ + THREAD_BASIC_INFORMATION ThreadBasic; + NTSTATUS Status; + + Status = NtQueryInformationThread(Thread, + ThreadBasicInformation, + &ThreadBasic, + sizeof(THREAD_BASIC_INFORMATION), + NULL); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return 0; + } + + return HandleToUlong(ThreadBasic.ClientId.UniqueThread); +} + +/* + * @unimplemented + */ +LANGID +WINAPI +SetThreadUILanguage(IN LANGID LangId) +{ + UNIMPLEMENTED; + return NtCurrentTeb()->CurrentLocale; +} + +/* + * @implemented + */ +DWORD +WINAPI +QueueUserAPC(IN PAPCFUNC pfnAPC, + IN HANDLE hThread, + IN ULONG_PTR dwData) +{ + NTSTATUS Status; + ACTIVATION_CONTEXT_BASIC_INFORMATION ActCtxInfo; + + /* Zero the activation context and query information on it */ + RtlZeroMemory(&ActCtxInfo, sizeof(ActCtxInfo)); + // WARNING!!! THIS IS USING THE WIN32 FLAG BECAUSE REACTOS CONTINUES TO BE A POS!!! /// + Status = RtlQueryInformationActivationContext(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, + NULL, + 0, + ActivationContextBasicInformation, + &ActCtxInfo, + sizeof(ActCtxInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + /* Fail due to SxS */ + DbgPrint("SXS: %s failing because RtlQueryInformationActivationContext()" + "returned status %08lx\n", __FUNCTION__, Status); + BaseSetLastNTError(Status); + return FALSE; + } + + /* Queue the APC */ + Status = NtQueueApcThread(hThread, + (PKNORMAL_ROUTINE)BaseDispatchApc, + pfnAPC, + (PVOID)dwData, + (ActCtxInfo.dwFlags & 1) ? + INVALID_ACTIVATION_CONTEXT : ActCtxInfo.hActCtx); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + /* All good */ + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes) +{ + UNIMPLEMENTED; + return FALSE; +} + +/* + * @implemented + */ +BOOL +WINAPI +GetThreadIOPendingFlag(IN HANDLE hThread, + OUT PBOOL lpIOIsPending) +{ + ULONG IoPending; + NTSTATUS Status; + + /* Query the flag */ + Status = NtQueryInformationThread(hThread, + ThreadIsIoPending, + &IoPending, + sizeof(IoPending), + NULL); + if (NT_SUCCESS(Status)) + { + /* Return the flag */ + *lpIOIsPending = IoPending ? TRUE : FALSE; + return TRUE; + } + + /* Fail */ BaseSetLastNTError(Status); - return 0; - } - - return HandleToUlong(ThreadBasic.ClientId.UniqueProcess); -} - -/* - * @implemented - */ -DWORD WINAPI -GetThreadId(HANDLE Thread) -{ - THREAD_BASIC_INFORMATION ThreadBasic; - NTSTATUS Status; - - Status = NtQueryInformationThread(Thread, - ThreadBasicInformation, - &ThreadBasic, - sizeof(THREAD_BASIC_INFORMATION), - NULL); - if(!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return 0; - } - - return HandleToUlong(ThreadBasic.ClientId.UniqueThread); -} - -/* - * @unimplemented - */ -LANGID WINAPI -SetThreadUILanguage(LANGID LangId) -{ - DPRINT1("SetThreadUILanguage(0x%4x) unimplemented!\n", LangId); - return LangId; -} - -static void CALLBACK -IntCallUserApc(PVOID Function, PVOID dwData, PVOID Argument3) -{ - PAPCFUNC pfnAPC = (PAPCFUNC)Function; - pfnAPC((ULONG_PTR)dwData); -} - -/* - * @implemented - */ -DWORD WINAPI -QueueUserAPC(PAPCFUNC pfnAPC, HANDLE hThread, ULONG_PTR dwData) -{ - NTSTATUS Status; - - Status = NtQueueApcThread(hThread, IntCallUserApc, pfnAPC, - (PVOID)dwData, NULL); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return 0; - } - - return 1; -} - -BOOL -WINAPI -SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes) -{ - STUB; return FALSE; } - -/* - * @implemented - */ -BOOL WINAPI -GetThreadIOPendingFlag(HANDLE hThread, - PBOOL lpIOIsPending) -{ - ULONG IoPending; - NTSTATUS Status; - - if(lpIOIsPending == NULL) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - Status = NtQueryInformationThread(hThread, - ThreadIsIoPending, - (PVOID)&IoPending, - sizeof(IoPending), - NULL); - if(NT_SUCCESS(Status)) - { - *lpIOIsPending = ((IoPending != 0) ? TRUE : FALSE); - return TRUE; - } - - BaseSetLastNTError(Status); - return FALSE; -} - - -typedef struct _QUEUE_USER_WORKITEM_CONTEXT -{ - LPTHREAD_START_ROUTINE Function; - PVOID Context; -} QUEUE_USER_WORKITEM_CONTEXT, *PQUEUE_USER_WORKITEM_CONTEXT; - -static VOID -NTAPI -InternalWorkItemTrampoline(PVOID Context) -{ - QUEUE_USER_WORKITEM_CONTEXT Info; - - ASSERT(Context); - - /* Save the context to the stack */ - Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context; - - /* Free the context before calling the callback. This avoids - a memory leak in case the thread dies... */ - RtlFreeHeap(RtlGetProcessHeap(), - 0, - Context); - - /* Call the real callback */ - Info.Function(Info.Context); -} - - -/* - * @implemented - */ -BOOL -WINAPI -QueueUserWorkItem( - LPTHREAD_START_ROUTINE Function, - PVOID Context, - ULONG Flags - ) -{ - PQUEUE_USER_WORKITEM_CONTEXT WorkItemContext; - NTSTATUS Status; - - /* Save the context for the trampoline function */ - WorkItemContext = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - sizeof(*WorkItemContext)); - if (WorkItemContext == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - WorkItemContext->Function = Function; - WorkItemContext->Context = Context; - - /* NOTE: Don't use Function directly since the callback signature - differs. This might cause problems on certain platforms... */ - Status = RtlQueueWorkItem(InternalWorkItemTrampoline, - WorkItemContext, - Flags); - if (!NT_SUCCESS(Status)) - { - /* Free the allocated context in case of failure */ - RtlFreeHeap(RtlGetProcessHeap(), - 0, - WorkItemContext); - - BaseSetLastNTError(Status); - return FALSE; - } - +/* + * @implemented + */ +BOOL +WINAPI +QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, + IN PVOID Context, + IN ULONG Flags) +{ + NTSTATUS Status; + + /* NOTE: Rtl needs to safely call the function using a trampoline */ + Status = RtlQueueWorkItem((WORKERCALLBACKFUNC)Function, Context, Flags); + if (!NT_SUCCESS(Status)) + { + /* Failed */ + BaseSetLastNTError(Status); + return FALSE; + } + + /* All good */ return TRUE; } @@ -1207,5 +1249,4 @@ return TRUE; } - /* EOF */
12 years, 7 months
1
0
0
0
[ion] 56650: [KERNEL32]: Reimplement DeleteFileA and W to handle the new ansi-Unicode functions, as well as to handle the same cases that Pierre implemented in the directory functions (dealing with...
by ion@svn.reactos.org
Author: ion Date: Wed May 23 16:51:22 2012 New Revision: 56650 URL:
http://svn.reactos.org/svn/reactos?rev=56650&view=rev
Log: [KERNEL32]: Reimplement DeleteFileA and W to handle the new ansi-Unicode functions, as well as to handle the same cases that Pierre implemented in the directory functions (dealing with reparse points and tags). Modified: trunk/reactos/dll/win32/kernel32/client/file/delete.c Modified: trunk/reactos/dll/win32/kernel32/client/file/delete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/delete.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/delete.c [iso-8859-1] Wed May 23 16:51:22 2012 @@ -14,7 +14,6 @@ #include <k32.h> #define NDEBUG #include <reactos/debug.h> -DEBUG_CHANNEL(kernel32file); /* FUNCTIONS ****************************************************************/ @@ -23,101 +22,214 @@ */ BOOL WINAPI -DeleteFileA ( - LPCSTR lpFileName - ) +DeleteFileA(IN LPCSTR lpFileName) { - PWCHAR FileNameW; - - if (!(FileNameW = FilenameA2W(lpFileName, FALSE))) - return FALSE; - - return DeleteFileW (FileNameW); + PUNICODE_STRING FileName; + + /* Convert the string to unicode, and call the wide function */ + FileName = Basep8BitStringToStaticUnicodeString(lpFileName); + if (FileName) return DeleteFileW(FileName->Buffer); + return FALSE; } - /* * @implemented */ BOOL WINAPI -DeleteFileW ( - LPCWSTR lpFileName - ) +DeleteFileW(IN LPCWSTR lpFileName) { - FILE_DISPOSITION_INFORMATION FileDispInfo; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - UNICODE_STRING NtPathU; - HANDLE FileHandle; - NTSTATUS Status; - - TRACE("DeleteFileW (lpFileName %S)\n",lpFileName); - - if (!RtlDosPathNameToNtPathName_U (lpFileName, - &NtPathU, - NULL, - NULL)) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } - - TRACE("NtPathU \'%wZ\'\n", &NtPathU); - - InitializeObjectAttributes(&ObjectAttributes, - &NtPathU, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtCreateFile (&FileHandle, - DELETE, - &ObjectAttributes, - &IoStatusBlock, - NULL, - FILE_ATTRIBUTE_NORMAL, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - FILE_OPEN, - FILE_NON_DIRECTORY_FILE, - NULL, - 0); - - RtlFreeHeap(RtlGetProcessHeap(), - 0, - NtPathU.Buffer); - - if (!NT_SUCCESS(Status)) - { - WARN("Status 0x%08x\n", Status); - BaseSetLastNTError (Status); - return FALSE; - } - - FileDispInfo.DeleteFile = TRUE; - - Status = NtSetInformationFile (FileHandle, - &IoStatusBlock, - &FileDispInfo, - sizeof(FILE_DISPOSITION_INFORMATION), - FileDispositionInformation); - if (!NT_SUCCESS(Status)) - { - WARN("Status 0x%08x\n", Status); - NtClose (FileHandle); - BaseSetLastNTError (Status); - return FALSE; - } - - Status = NtClose (FileHandle); - if (!NT_SUCCESS (Status)) - { - WARN("Status 0x%08x\n", Status); - BaseSetLastNTError (Status); - return FALSE; - } - - return TRUE; + FILE_DISPOSITION_INFORMATION FileDispInfo; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + UNICODE_STRING NtPathU; + HANDLE FileHandle; + NTSTATUS Status; + RTL_RELATIVE_NAME_U RelativeName; + PWCHAR PathBuffer; + FILE_ATTRIBUTE_TAG_INFORMATION FileTagInformation; + + /* Convert to NT path and get the relative name too */ + if (!RtlDosPathNameToNtPathName_U(lpFileName, + &NtPathU, + NULL, + &RelativeName)) + { + /* Bail out if the path name makes no sense */ + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* Save the path buffer in case we free it later */ + PathBuffer = NtPathU.Buffer; + + /* If we have a relative name... */ + if (RelativeName.RelativeName.Length) + { + /* Do a relative open with only the relative path set */ + NtPathU = RelativeName.RelativeName; + } + else + { + /* Do a full path open with no containing directory */ + RelativeName.ContainingDirectory = NULL; + } + + /* Now open the directory name that was passed in */ + InitializeObjectAttributes(&ObjectAttributes, + &NtPathU, + OBJ_CASE_INSENSITIVE, + RelativeName.ContainingDirectory, + NULL); + Status = NtOpenFile(&FileHandle, + DELETE | FILE_READ_ATTRIBUTES, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_NON_DIRECTORY_FILE | + FILE_OPEN_FOR_BACKUP_INTENT | + FILE_OPEN_REPARSE_POINT); + if (NT_SUCCESS(Status)) + { + /* Check if there's a reparse point associated with this file handle */ + Status = NtQueryInformationFile(FileHandle, + &IoStatusBlock, + &FileTagInformation, + sizeof(FileTagInformation), + FileAttributeTagInformation); + if ((NT_SUCCESS(Status)) && + (FileTagInformation.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) && + (FileTagInformation.ReparseTag != IO_REPARSE_TAG_MOUNT_POINT)) + { + /* There is, so now try to open it with reparse behavior */ + NtClose(FileHandle); + Status = NtOpenFile(&FileHandle, + DELETE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_DELETE | + FILE_SHARE_READ | + FILE_SHARE_WRITE, + FILE_NON_DIRECTORY_FILE | + FILE_OPEN_FOR_BACKUP_INTENT); + if (!NT_SUCCESS(Status)) + { + /* We failed -- maybe whoever is handling this tag isn't there */ + if (Status == STATUS_IO_REPARSE_TAG_NOT_HANDLED) + { + /* Try to open it for delete, without reparse behavior */ + Status = NtOpenFile(&FileHandle, + DELETE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | + FILE_SHARE_WRITE | + FILE_SHARE_DELETE, + FILE_NON_DIRECTORY_FILE | + FILE_OPEN_FOR_BACKUP_INTENT | + FILE_OPEN_REPARSE_POINT); + } + + if (!NT_SUCCESS(Status)) + { + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer); + BaseSetLastNTError(Status); + return FALSE; + } + } + } + else if (!(NT_SUCCESS(Status)) && + (Status != STATUS_NOT_IMPLEMENTED) && + (Status != STATUS_INVALID_PARAMETER)) + { + /* We had some critical error querying the attributes, bail out */ + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer); + NtClose(FileHandle); + BaseSetLastNTError(Status); + return FALSE; + } + } + else + { + /* It's possible that FILE_OPEN_REPARSE_POINT was not understood */ + if (Status == STATUS_INVALID_PARAMETER) + { + /* Try opening the file normally, with reparse behavior */ + Status = NtOpenFile(&FileHandle, + DELETE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_DELETE | + FILE_SHARE_READ | + FILE_SHARE_WRITE, + FILE_NON_DIRECTORY_FILE | + FILE_OPEN_FOR_BACKUP_INTENT); + if (!NT_SUCCESS(Status)) + { + /* This failed too, fail */ + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer); + BaseSetLastNTError(Status); + return FALSE; + } + } + else + { + /* Maybe we didn't have READ_ATTRIBUTE rights? */ + if (Status != STATUS_ACCESS_DENIED) + { + /* Nope, it was something else, let's fail */ + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer); + BaseSetLastNTError(Status); + return FALSE; + } + + /* Let's try again, without querying attributes */ + Status = NtOpenFile(&FileHandle, + DELETE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_DELETE | + FILE_SHARE_READ | + FILE_SHARE_WRITE, + FILE_NON_DIRECTORY_FILE | + FILE_OPEN_FOR_BACKUP_INTENT | + FILE_OPEN_REPARSE_POINT); + if (!NT_SUCCESS(Status)) + { + /* This failed too, so bail out */ + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer); + BaseSetLastNTError(Status); + return FALSE; + } + } + } + + /* Ready to delete the file, so cleanup temporary data */ + RtlReleaseRelativeName(&RelativeName); + RtlFreeHeap(RtlGetProcessHeap(), 0, PathBuffer); + + /* Ask for the file to be deleted */ + FileDispInfo.DeleteFile = TRUE; + Status = NtSetInformationFile(FileHandle, + &IoStatusBlock, + &FileDispInfo, + sizeof(FILE_DISPOSITION_INFORMATION), + FileDispositionInformation); + NtClose(FileHandle); + if (!NT_SUCCESS(Status)) + { + /* Deletion failed, tell the caller */ + BaseSetLastNTError(Status); + return FALSE; + } + + /* Tell the caller deletion worked */ + return TRUE; } /* EOF */
12 years, 7 months
1
0
0
0
[tfaber] 56649: [RTL] - Use RtlAnsiStringToUnicodeString instead of mbstowcs to correctly handle manifests that aren't null-terminated See issue #6743 for more details.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed May 23 11:54:20 2012 New Revision: 56649 URL:
http://svn.reactos.org/svn/reactos?rev=56649&view=rev
Log: [RTL] - Use RtlAnsiStringToUnicodeString instead of mbstowcs to correctly handle manifests that aren't null-terminated See issue #6743 for more details. Modified: trunk/reactos/lib/rtl/actctx.c Modified: trunk/reactos/lib/rtl/actctx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/actctx.c?rev=56649…
============================================================================== --- trunk/reactos/lib/rtl/actctx.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/actctx.c [iso-8859-1] Wed May 23 11:54:20 2012 @@ -1576,13 +1576,17 @@ } else { - /* let's assume utf-8 for now */ - size_t len; - WCHAR *new_buff; + /* TODO: this doesn't handle arbitrary encodings */ + ANSI_STRING xmlA; + UNICODE_STRING xmlW; + + ASSERT(size < MAXUSHORT); + xmlA.Buffer = (PCHAR)buffer; + xmlA.Length = xmlA.MaximumLength = (USHORT)size; _SEH2_TRY { - len = mbstowcs(NULL, buffer, size); + status = RtlAnsiStringToUnicodeString(&xmlW, &xmlA, TRUE); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -1591,23 +1595,18 @@ } _SEH2_END; - DPRINT("len = %x\n", len); - - if (len == -1) - { - DPRINT1( "utf-8 conversion failed\n" ); + if (!NT_SUCCESS(status)) + { + DPRINT1("RtlAnsiStringToUnicodeString failed with %lx\n", status); return STATUS_SXS_CANT_GEN_ACTCTX; } - if (!(new_buff = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, len))) - return STATUS_NO_MEMORY; - - mbstowcs( new_buff, buffer, size); - xmlbuf.ptr = new_buff; - - xmlbuf.end = xmlbuf.ptr + len / sizeof(WCHAR); + ASSERT(xmlW.Buffer != NULL); + + xmlbuf.ptr = xmlW.Buffer; + xmlbuf.end = xmlbuf.ptr + xmlW.Length / sizeof(WCHAR); status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf ); - RtlFreeHeap( RtlGetProcessHeap(), 0, new_buff ); + RtlFreeUnicodeString(&xmlW); } return status; }
12 years, 7 months
1
0
0
0
[ekohl] 56648: [SAMLIB/SAMSRV/SYSSETUP] - Use Wine debug messages in samlib.dll. - Move SAM initialization code from samlib.dll to samsrv.dll. - Lsass.exe initializes SAM instead of syssetup.dll.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon May 21 13:38:32 2012 New Revision: 56648 URL:
http://svn.reactos.org/svn/reactos?rev=56648&view=rev
Log: [SAMLIB/SAMSRV/SYSSETUP] - Use Wine debug messages in samlib.dll. - Move SAM initialization code from samlib.dll to samsrv.dll. - Lsass.exe initializes SAM instead of syssetup.dll. Added: trunk/reactos/dll/win32/samsrv/setup.c (with props) Modified: trunk/reactos/dll/win32/samlib/CMakeLists.txt trunk/reactos/dll/win32/samlib/dllmain.c trunk/reactos/dll/win32/samlib/precomp.h trunk/reactos/dll/win32/samlib/samlib.c trunk/reactos/dll/win32/samlib/samlib.spec trunk/reactos/dll/win32/samsrv/CMakeLists.txt trunk/reactos/dll/win32/samsrv/samsrv.c trunk/reactos/dll/win32/samsrv/samsrv.h trunk/reactos/dll/win32/syssetup/install.c trunk/reactos/include/reactos/libs/samlib/samlib.h 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] Mon May 21 13:38:32 2012 @@ -21,6 +21,7 @@ add_library(samlib SHARED ${SOURCE}) set_module_type(samlib win32dll UNICODE) +target_link_libraries(samlib wine ${PSEH_LIB}) 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/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/dllmain.c…
============================================================================== --- trunk/reactos/dll/win32/samlib/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samlib/dllmain.c [iso-8859-1] Mon May 21 13:38:32 2012 @@ -29,7 +29,7 @@ #include "precomp.h" -//#define LOG_DEBUG_MESSAGES +WINE_DEFAULT_DEBUG_CHANNEL(samlib); /* GLOBALS *******************************************************************/ @@ -45,50 +45,4 @@ return TRUE; } - -void -DebugPrint (char* fmt,...) -{ -#ifdef LOG_DEBUG_MESSAGES - char FileName[MAX_PATH]; - HANDLE hLogFile; - DWORD dwBytesWritten; -#endif - char buffer[512]; - va_list ap; - - va_start (ap, fmt); - vsprintf (buffer, fmt, ap); - va_end (ap); - - OutputDebugStringA (buffer); - -#ifdef LOG_DEBUG_MESSAGES - strcpy (FileName, "C:\\reactos\\samlib.log"); - hLogFile = CreateFileA (FileName, - GENERIC_WRITE, - 0, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - if (hLogFile == INVALID_HANDLE_VALUE) - return; - - if (SetFilePointer(hLogFile, 0, NULL, FILE_END) == 0xFFFFFFFF) - { - CloseHandle (hLogFile); - return; - } - - WriteFile (hLogFile, - buffer, - strlen(buffer), - &dwBytesWritten, - NULL); - - CloseHandle (hLogFile); -#endif -} - /* EOF */ 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] Mon May 21 13:38:32 2012 @@ -10,4 +10,4 @@ #include "sam_c.h" -#include "debug.h" +#include <wine/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] Mon May 21 13:38:32 2012 @@ -27,276 +27,14 @@ /* INCLUDES *****************************************************************/ -#define NDEBUG #include "precomp.h" +WINE_DEFAULT_DEBUG_CHANNEL(samlib); /* GLOBALS *******************************************************************/ /* FUNCTIONS *****************************************************************/ - - -static BOOL -CreateBuiltinAliases (HKEY hAliasesKey) -{ - return TRUE; -} - - -static BOOL -CreateBuiltinGroups (HKEY hGroupsKey) -{ - return TRUE; -} - - -static BOOL -CreateBuiltinUsers (HKEY hUsersKey) -{ - return TRUE; -} - - -BOOL WINAPI -SamInitializeSAM (VOID) -{ - DWORD dwDisposition; - HKEY hSamKey; - HKEY hDomainsKey; - HKEY hAccountKey; - HKEY hBuiltinKey; - HKEY hAliasesKey; - HKEY hGroupsKey; - HKEY hUsersKey; - - DPRINT("SamInitializeSAM() called\n"); - - if (RegCreateKeyExW (HKEY_LOCAL_MACHINE, - L"SAM\\SAM", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hSamKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Sam' key! (Error %lu)\n", GetLastError()); - return FALSE; - } - - if (RegCreateKeyExW (hSamKey, - L"Domains", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hDomainsKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Domains' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hSamKey); - return FALSE; - } - - RegCloseKey (hSamKey); - - /* Create the 'Domains\\Account' key */ - if (RegCreateKeyExW (hDomainsKey, - L"Account", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hAccountKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Domains\\Account' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hDomainsKey); - return FALSE; - } - - - /* Create the 'Account\Aliases' key */ - if (RegCreateKeyExW (hAccountKey, - L"Aliases", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hAliasesKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Account\\Aliases' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hAccountKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - RegCloseKey (hAliasesKey); - - - /* Create the 'Account\Groups' key */ - if (RegCreateKeyExW (hAccountKey, - L"Groups", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hGroupsKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Account\\Groups' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hAccountKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - RegCloseKey (hGroupsKey); - - - /* Create the 'Account\Users' key */ - if (RegCreateKeyExW (hAccountKey, - L"Users", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hUsersKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Account\\Users' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hAccountKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - RegCloseKey (hUsersKey); - - RegCloseKey (hAccountKey); - - - /* Create the 'Domains\\Builtin' */ - if (RegCreateKeyExW (hDomainsKey, - L"Builtin", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hBuiltinKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create Builtin key! (Error %lu)\n", GetLastError()); - RegCloseKey (hDomainsKey); - return FALSE; - } - - - /* Create the 'Builtin\Aliases' key */ - if (RegCreateKeyExW (hBuiltinKey, - L"Aliases", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hAliasesKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Builtin\\Aliases' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hBuiltinKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - /* Create builtin aliases */ - if (!CreateBuiltinAliases (hAliasesKey)) - { - DPRINT1 ("Failed to create builtin aliases!\n"); - RegCloseKey (hAliasesKey); - RegCloseKey (hBuiltinKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - RegCloseKey (hAliasesKey); - - - /* Create the 'Builtin\Groups' key */ - if (RegCreateKeyExW (hBuiltinKey, - L"Groups", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hGroupsKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Builtin\\Groups' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hBuiltinKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - /* Create builtin groups */ - if (!CreateBuiltinGroups (hGroupsKey)) - { - DPRINT1 ("Failed to create builtin groups!\n"); - RegCloseKey (hGroupsKey); - RegCloseKey (hBuiltinKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - RegCloseKey (hGroupsKey); - - - /* Create the 'Builtin\Users' key */ - if (RegCreateKeyExW (hBuiltinKey, - L"Users", - 0, - NULL, - REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, - NULL, - &hUsersKey, - &dwDisposition)) - { - DPRINT1 ("Failed to create 'Builtin\\Users' key! (Error %lu)\n", GetLastError()); - RegCloseKey (hBuiltinKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - /* Create builtin users */ - if (!CreateBuiltinUsers (hUsersKey)) - { - DPRINT1 ("Failed to create builtin users!\n"); - RegCloseKey (hUsersKey); - RegCloseKey (hBuiltinKey); - RegCloseKey (hDomainsKey); - return FALSE; - } - - RegCloseKey (hUsersKey); - - RegCloseKey (hBuiltinKey); - - RegCloseKey (hDomainsKey); - - DPRINT ("SamInitializeSAM() done\n"); - - return TRUE; -} - /* * ERROR_USER_EXISTS @@ -310,7 +48,7 @@ HKEY hUsersKey; HKEY hUserKey; - DPRINT ("SamCreateUser() called\n"); + TRACE("SamCreateUser() called\n"); /* FIXME: Check whether the SID is a real user sid */ @@ -321,7 +59,7 @@ KEY_ALL_ACCESS, &hUsersKey)) { - DPRINT1 ("Failed to open Account key! (Error %lu)\n", GetLastError()); + ERR("Failed to open Account key! (Error %lu)\n", GetLastError()); return FALSE; } @@ -336,7 +74,7 @@ &hUserKey, &dwDisposition)) { - DPRINT1 ("Failed to create/open the user key! (Error %lu)\n", GetLastError()); + ERR("Failed to create/open the user key! (Error %lu)\n", GetLastError()); RegCloseKey (hUsersKey); return FALSE; } @@ -345,7 +83,7 @@ if (dwDisposition == REG_OPENED_EXISTING_KEY) { - DPRINT1 ("User already exists!\n"); + ERR("User already exists!\n"); RegCloseKey (hUserKey); SetLastError (ERROR_USER_EXISTS); return FALSE; @@ -360,7 +98,7 @@ (LPBYTE)UserName, (wcslen (UserName) + 1) * sizeof (WCHAR))) { - DPRINT1 ("Failed to set the user name value! (Error %lu)\n", GetLastError()); + ERR("Failed to set the user name value! (Error %lu)\n", GetLastError()); RegCloseKey (hUserKey); return FALSE; } @@ -373,7 +111,7 @@ (LPBYTE)UserPassword, (wcslen (UserPassword) + 1) * sizeof (WCHAR))) { - DPRINT1 ("Failed to set the user name value! (Error %lu)\n", GetLastError()); + ERR("Failed to set the user name value! (Error %lu)\n", GetLastError()); RegCloseKey (hUserKey); return FALSE; } @@ -386,14 +124,14 @@ (LPBYTE)UserSid, RtlLengthSid (UserSid))) { - DPRINT1 ("Failed to set the user SID value! (Error %lu)\n", GetLastError()); + ERR("Failed to set the user SID value! (Error %lu)\n", GetLastError()); RegCloseKey (hUserKey); return FALSE; } RegCloseKey (hUserKey); - DPRINT ("SamCreateUser() done\n"); + TRACE("SamCreateUser() done\n"); return TRUE; } @@ -412,7 +150,7 @@ HKEY hUsersKey; HKEY hUserKey; - DPRINT ("SamCheckUserPassword() called\n"); + TRACE("SamCheckUserPassword() called\n"); /* Open the Users key */ if (RegOpenKeyExW (HKEY_LOCAL_MACHINE, @@ -421,7 +159,7 @@ KEY_READ, &hUsersKey)) { - DPRINT1 ("Failed to open Users key! (Error %lu)\n", GetLastError()); + ERR("Failed to open Users key! (Error %lu)\n", GetLastError()); return FALSE; } @@ -434,12 +172,12 @@ { if (GetLastError () == ERROR_FILE_NOT_FOUND) { - DPRINT1 ("Invalid user name!\n"); + ERR("Invalid user name!\n"); SetLastError (ERROR_NO_SUCH_USER); } else { - DPRINT1 ("Failed to open user key! (Error %lu)\n", GetLastError()); + ERR("Failed to open user key! (Error %lu)\n", GetLastError()); } RegCloseKey (hUsersKey); @@ -457,7 +195,7 @@ (LPBYTE)szPassword, &dwLength)) { - DPRINT1 ("Failed to read the password! (Error %lu)\n", GetLastError()); + ERR("Failed to read the password! (Error %lu)\n", GetLastError()); RegCloseKey (hUserKey); return FALSE; } @@ -468,12 +206,12 @@ if ((wcslen (szPassword) != wcslen (UserPassword)) || (wcscmp (szPassword, UserPassword) != 0)) { - DPRINT1 ("Wrong password!\n"); + ERR("Wrong password!\n"); SetLastError (ERROR_WRONG_PASSWORD); return FALSE; } - DPRINT ("SamCheckUserPassword() done\n"); + TRACE("SamCheckUserPassword() done\n"); return TRUE; } @@ -488,7 +226,7 @@ HKEY hUsersKey; HKEY hUserKey; - DPRINT ("SamGetUserSid() called\n"); + TRACE("SamGetUserSid() called\n"); if (Sid != NULL) *Sid = NULL; @@ -500,7 +238,7 @@ KEY_READ, &hUsersKey)) { - DPRINT1 ("Failed to open Users key! (Error %lu)\n", GetLastError()); + ERR("Failed to open Users key! (Error %lu)\n", GetLastError()); return FALSE; } @@ -513,12 +251,12 @@ { if (GetLastError () == ERROR_FILE_NOT_FOUND) { - DPRINT1 ("Invalid user name!\n"); + ERR("Invalid user name!\n"); SetLastError (ERROR_NO_SUCH_USER); } else { - DPRINT1 ("Failed to open user key! (Error %lu)\n", GetLastError()); + ERR("Failed to open user key! (Error %lu)\n", GetLastError()); } RegCloseKey (hUsersKey); @@ -536,19 +274,19 @@ NULL, &dwLength)) { - DPRINT1 ("Failed to read the SID size! (Error %lu)\n", GetLastError()); + ERR("Failed to read the SID size! (Error %lu)\n", GetLastError()); RegCloseKey (hUserKey); return FALSE; } /* Allocate sid buffer */ - DPRINT ("Required SID buffer size: %lu\n", dwLength); + TRACE("Required SID buffer size: %lu\n", dwLength); lpSid = (PSID)RtlAllocateHeap (RtlGetProcessHeap (), 0, dwLength); if (lpSid == NULL) { - DPRINT1 ("Failed to allocate SID buffer!\n"); + ERR("Failed to allocate SID buffer!\n"); RegCloseKey (hUserKey); return FALSE; } @@ -561,7 +299,7 @@ (LPBYTE)lpSid, &dwLength)) { - DPRINT1 ("Failed to read the SID! (Error %lu)\n", GetLastError()); + ERR("Failed to read the SID! (Error %lu)\n", GetLastError()); RtlFreeHeap (RtlGetProcessHeap (), 0, lpSid); @@ -573,7 +311,7 @@ *Sid = lpSid; - DPRINT ("SamGetUserSid() done\n"); + TRACE("SamGetUserSid() done\n"); return TRUE; } @@ -597,7 +335,7 @@ LPWSTR pszStringBinding; RPC_STATUS status; -// TRACE("PSAMPR_SERVER_NAME_bind() called\n"); + TRACE("PSAMPR_SERVER_NAME_bind() called\n"); status = RpcStringBindingComposeW(NULL, L"ncacn_np", @@ -607,7 +345,7 @@ &pszStringBinding); if (status) { -// TRACE("RpcStringBindingCompose returned 0x%x\n", status); + TRACE("RpcStringBindingCompose returned 0x%x\n", status); return NULL; } @@ -616,7 +354,7 @@ &hBinding); if (status) { -// TRACE("RpcBindingFromStringBinding returned 0x%x\n", status); + TRACE("RpcBindingFromStringBinding returned 0x%x\n", status); } status = RpcStringFreeW(&pszStringBinding); @@ -635,12 +373,12 @@ { RPC_STATUS status; -// TRACE("PSAMPR_SERVER_NAME_unbind() called\n"); + TRACE("PSAMPR_SERVER_NAME_unbind() called\n"); status = RpcBindingFree(&hBinding); if (status) { -// TRACE("RpcBindingFree returned 0x%x\n", status); + TRACE("RpcBindingFree returned 0x%x\n", status); } } 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] Mon May 21 13:38:32 2012 @@ -64,7 +64,6 @@ @ stub SamiSetDSRMPassword @ stub SamiSetDSRMPasswordOWF -@ stdcall SamInitializeSAM() @ stdcall SamCreateUser(wstr wstr ptr) @ stdcall SamCheckUserPassword(wstr wstr) @ stdcall SamGetUserSid(wstr ptr) Modified: trunk/reactos/dll/win32/samsrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/samsrv/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/CMakeLists.txt [iso-8859-1] Mon May 21 13:38:32 2012 @@ -10,6 +10,7 @@ list(APPEND SOURCE samrpc.c samsrv.c + setup.c samsrv.rc ${CMAKE_CURRENT_BINARY_DIR}/samsrv_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/samsrv.def @@ -19,6 +20,6 @@ set_module_type(samsrv win32dll ENTRYPOINT 0 UNICODE) target_link_libraries(samsrv wine ${PSEH_LIB}) -add_importlibs(samsrv rpcrt4 kernel32 ntdll) +add_importlibs(samsrv rpcrt4 advapi32 kernel32 ntdll) add_dependencies(samsrv psdk) add_cd_file(TARGET samsrv DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/samsrv/samsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.c [iso-8859-1] Mon May 21 13:38:32 2012 @@ -29,9 +29,15 @@ NTAPI SamIInitialize(VOID) { + NTSTATUS Status = STATUS_SUCCESS; + TRACE("SamIInitialize() called\n"); - return STATUS_SUCCESS; + if (SampIsSetupRunning()) + Status = SampInitializeRegistry(); + + + return Status; } @@ -41,6 +47,8 @@ { TRACE("SampInitializeRegistry() called\n"); + SampInitializeSAM(); + return STATUS_SUCCESS; } Modified: trunk/reactos/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Mon May 21 13:38:32 2012 @@ -16,4 +16,9 @@ #include "sam_s.h" -#include <wine/debug.h> +#include <wine/debug.h> + + +/* setup.c */ +BOOL SampIsSetupRunning(VOID); +BOOL SampInitializeSAM(VOID); Added: trunk/reactos/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/setup.c (added) +++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Mon May 21 13:38:32 2012 @@ -1,0 +1,316 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: Security Account Manager (SAM) Server + * FILE: reactos/dll/win32/samsrv/setup.c + * PURPOSE: Registry setup routines + * + * PROGRAMMERS: Eric Kohl + */ + +/* INCLUDES ****************************************************************/ + +#include "samsrv.h" + +WINE_DEFAULT_DEBUG_CHANNEL(samsrv); + + +/* FUNCTIONS ***************************************************************/ + +BOOL +SampIsSetupRunning(VOID) +{ + DWORD dwError; + HKEY hKey; + DWORD dwType; + DWORD dwSize; + DWORD dwSetupType; + + TRACE("SampIsSetupRunning()\n"); + + /* Open key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\Setup", + 0, + KEY_QUERY_VALUE, + &hKey); + if (dwError != ERROR_SUCCESS) + return FALSE; + + /* Read key */ + dwSize = sizeof(DWORD); + dwError = RegQueryValueExW(hKey, + L"SetupType", + NULL, + &dwType, + (LPBYTE)&dwSetupType, + &dwSize); + + /* Close key, and check if returned values are correct */ + RegCloseKey(hKey); + if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD)) + return FALSE; + + TRACE("SampIsSetupRunning() returns %s\n", (dwSetupType != 0) ? "TRUE" : "FALSE"); + return (dwSetupType != 0); +} + + +static BOOL +CreateBuiltinAliases(HKEY hAliasesKey) +{ + return TRUE; +} + + +static BOOL +CreateBuiltinGroups(HKEY hGroupsKey) +{ + return TRUE; +} + + +static BOOL +CreateBuiltinUsers(HKEY hUsersKey) +{ + return TRUE; +} + + +BOOL +SampInitializeSAM(VOID) +{ + DWORD dwDisposition; + HKEY hSamKey; + HKEY hDomainsKey; + HKEY hAccountKey; + HKEY hBuiltinKey; + HKEY hAliasesKey; + HKEY hGroupsKey; + HKEY hUsersKey; + + TRACE("SampInitializeSAM() called\n"); + + if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, + L"SAM\\SAM", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hSamKey, + &dwDisposition)) + { + ERR("Failed to create 'Sam' key! (Error %lu)\n", GetLastError()); + return FALSE; + } + + if (RegCreateKeyExW(hSamKey, + L"Domains", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hDomainsKey, + &dwDisposition)) + { + ERR("Failed to create 'Domains' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hSamKey); + return FALSE; + } + + RegCloseKey (hSamKey); + + /* Create the 'Domains\\Account' key */ + if (RegCreateKeyExW(hDomainsKey, + L"Account", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hAccountKey, + &dwDisposition)) + { + ERR("Failed to create 'Domains\\Account' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hDomainsKey); + return FALSE; + } + + + /* Create the 'Account\Aliases' key */ + if (RegCreateKeyExW(hAccountKey, + L"Aliases", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hAliasesKey, + &dwDisposition)) + { + ERR("Failed to create 'Account\\Aliases' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hAccountKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + RegCloseKey (hAliasesKey); + + + /* Create the 'Account\Groups' key */ + if (RegCreateKeyExW(hAccountKey, + L"Groups", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hGroupsKey, + &dwDisposition)) + { + ERR("Failed to create 'Account\\Groups' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hAccountKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + RegCloseKey(hGroupsKey); + + + /* Create the 'Account\Users' key */ + if (RegCreateKeyExW(hAccountKey, + L"Users", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hUsersKey, + &dwDisposition)) + { + ERR("Failed to create 'Account\\Users' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hAccountKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + RegCloseKey(hUsersKey); + + RegCloseKey(hAccountKey); + + + /* Create the 'Domains\\Builtin' */ + if (RegCreateKeyExW(hDomainsKey, + L"Builtin", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hBuiltinKey, + &dwDisposition)) + { + ERR("Failed to create Builtin key! (Error %lu)\n", GetLastError()); + RegCloseKey(hDomainsKey); + return FALSE; + } + + + /* Create the 'Builtin\Aliases' key */ + if (RegCreateKeyExW(hBuiltinKey, + L"Aliases", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hAliasesKey, + &dwDisposition)) + { + ERR("Failed to create 'Builtin\\Aliases' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hBuiltinKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + /* Create builtin aliases */ + if (!CreateBuiltinAliases(hAliasesKey)) + { + ERR("Failed to create builtin aliases!\n"); + RegCloseKey(hAliasesKey); + RegCloseKey(hBuiltinKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + RegCloseKey(hAliasesKey); + + + /* Create the 'Builtin\Groups' key */ + if (RegCreateKeyExW(hBuiltinKey, + L"Groups", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hGroupsKey, + &dwDisposition)) + { + ERR("Failed to create 'Builtin\\Groups' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hBuiltinKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + /* Create builtin groups */ + if (!CreateBuiltinGroups(hGroupsKey)) + { + ERR("Failed to create builtin groups!\n"); + RegCloseKey(hGroupsKey); + RegCloseKey(hBuiltinKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + RegCloseKey(hGroupsKey); + + + /* Create the 'Builtin\Users' key */ + if (RegCreateKeyExW(hBuiltinKey, + L"Users", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &hUsersKey, + &dwDisposition)) + { + ERR("Failed to create 'Builtin\\Users' key! (Error %lu)\n", GetLastError()); + RegCloseKey(hBuiltinKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + /* Create builtin users */ + if (!CreateBuiltinUsers(hUsersKey)) + { + ERR("Failed to create builtin users!\n"); + RegCloseKey(hUsersKey); + RegCloseKey(hBuiltinKey); + RegCloseKey(hDomainsKey); + return FALSE; + } + + RegCloseKey(hUsersKey); + + RegCloseKey(hBuiltinKey); + + RegCloseKey(hDomainsKey); + + TRACE("SampInitializeSAM() done\n"); + + return TRUE; +} Propchange: trunk/reactos/dll/win32/samsrv/setup.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/samsrv/setup.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Modified: trunk/reactos/dll/win32/syssetup/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install…
============================================================================== --- trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] Mon May 21 13:38:32 2012 @@ -893,13 +893,6 @@ return 0; } - /* Initialize the Security Account Manager (SAM) */ - if (!SamInitializeSAM()) - { - FatalError("SamInitializeSAM() failed!"); - return 0; - } - /* Create the semi-random Domain-SID */ if (!CreateRandomSid(&DomainSid)) { Modified: trunk/reactos/include/reactos/libs/samlib/samlib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/samli…
============================================================================== --- trunk/reactos/include/reactos/libs/samlib/samlib.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/samlib/samlib.h [iso-8859-1] Mon May 21 13:38:32 2012 @@ -27,9 +27,6 @@ BOOL WINAPI -SamInitializeSAM (VOID); - -BOOL WINAPI SamCreateUser (PWSTR UserName, PWSTR UserPassword, PSID UserSid);
12 years, 7 months
1
0
0
0
[ekohl] 56647: [LSASS] Load samsrv.dll and call SamIInitialize when lsass is started.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 20 21:10:53 2012 New Revision: 56647 URL:
http://svn.reactos.org/svn/reactos?rev=56647&view=rev
Log: [LSASS] Load samsrv.dll and call SamIInitialize when lsass is started. Modified: trunk/reactos/base/system/lsass/CMakeLists.txt trunk/reactos/base/system/lsass/lsass.c Modified: trunk/reactos/base/system/lsass/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/lsass/CMakeLis…
============================================================================== --- trunk/reactos/base/system/lsass/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/lsass/CMakeLists.txt [iso-8859-1] Sun May 20 21:10:53 2012 @@ -5,5 +5,5 @@ add_executable(lsass lsass.c lsass.rc) set_module_type(lsass win32gui UNICODE) -add_importlibs(lsass advapi32 lsasrv msvcrt kernel32 ntdll) +add_importlibs(lsass advapi32 lsasrv samsrv msvcrt kernel32 ntdll) add_cd_file(TARGET lsass DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/base/system/lsass/lsass.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/lsass/lsass.c?…
============================================================================== --- trunk/reactos/base/system/lsass/lsass.c [iso-8859-1] (original) +++ trunk/reactos/base/system/lsass/lsass.c [iso-8859-1] Sun May 20 21:10:53 2012 @@ -30,7 +30,7 @@ #include <ndk/psfuncs.h> #include <lsass/lsasrv.h> -//#include <samsrv.h> +#include <samsrv/samsrv.h> #include <lsass/lsass.h> #define NDEBUG @@ -63,7 +63,6 @@ goto ByeBye; } -#if 0 /* Initialize the SAM server DLL. */ Status = SamIInitialize(); if (!NT_SUCCESS(Status)) @@ -71,7 +70,6 @@ DPRINT1("SamIInitialize() failed (Status 0x%08lX)\n", Status); goto ByeBye; } -#endif /* FIXME: More initialization */
12 years, 7 months
1
0
0
0
[ekohl] 56646: [samlib] - Add DDK header ntsam.h. - Add some client side stubs of the SAM RPC interface.
by ekohl@svn.reactos.org
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
12 years, 7 months
1
0
0
0
[ekohl] 56645: [SAMSRV] - Convert to Wine debug messages. - Add server side stubs of the SAM RPC interface. The RPC server is not implemented yet.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 20 18:31:10 2012 New Revision: 56645 URL:
http://svn.reactos.org/svn/reactos?rev=56645&view=rev
Log: [SAMSRV] - Convert to Wine debug messages. - Add server side stubs of the SAM RPC interface. The RPC server is not implemented yet. Added: trunk/reactos/dll/win32/samsrv/samrpc.c (with props) trunk/reactos/dll/win32/samsrv/samsrv.h (with props) trunk/reactos/include/reactos/libs/samsrv/ (with props) trunk/reactos/include/reactos/libs/samsrv/samsrv.h (with props) Modified: trunk/reactos/dll/win32/samsrv/CMakeLists.txt trunk/reactos/dll/win32/samsrv/samsrv.c trunk/reactos/dll/win32/samsrv/samsrv.spec Modified: trunk/reactos/dll/win32/samsrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/samsrv/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/CMakeLists.txt [iso-8859-1] Sun May 20 18:31:10 2012 @@ -1,16 +1,24 @@ +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${REACTOS_SOURCE_DIR}/include/reactos/idl) -spec2def(samsrv.dll samsrv.spec) +add_rpc_files(server ${REACTOS_SOURCE_DIR}/include/reactos/idl/sam.idl) + +spec2def(samsrv.dll samsrv.spec ADD_IMPORTLIB) list(APPEND SOURCE + samrpc.c samsrv.c samsrv.rc - ${CMAKE_CURRENT_BINARY_DIR}/samsrv.def) + ${CMAKE_CURRENT_BINARY_DIR}/samsrv_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/samsrv.def + ${CMAKE_CURRENT_BINARY_DIR}/sam_s.c) add_library(samsrv SHARED ${SOURCE}) - set_module_type(samsrv win32dll ENTRYPOINT 0 UNICODE) -add_importlibs(samsrv kernel32 ntdll) +target_link_libraries(samsrv wine ${PSEH_LIB}) +add_importlibs(samsrv rpcrt4 kernel32 ntdll) add_dependencies(samsrv psdk) add_cd_file(TARGET samsrv DESTINATION reactos/system32 FOR all) Added: trunk/reactos/dll/win32/samsrv/samrpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samrpc.c (added) +++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sun May 20 18:31:10 2012 @@ -1,0 +1,816 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: Security Account Manager (SAM) Server + * FILE: reactos/dll/win32/samsrv/samrpc.c + * PURPOSE: RPC interface functions + * + * PROGRAMMERS: Eric Kohl + */ + +/* INCLUDES ****************************************************************/ + +#include "samsrv.h" + +WINE_DEFAULT_DEBUG_CHANNEL(samsrv); + + +/* FUNCTIONS ***************************************************************/ + +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); +} + +void __RPC_USER SAMPR_HANDLE_rundown(SAMPR_HANDLE hHandle) +{ +} + +/* Function 0 */ +NTSTATUS +NTAPI +SamrConnect(IN PSAMPR_SERVER_NAME ServerName, + OUT SAMPR_HANDLE *ServerHandle, + IN ACCESS_MASK DesiredAccess) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 1 */ +NTSTATUS +NTAPI +SamrCloseHandle(IN OUT SAMPR_HANDLE *SamHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 2 */ +NTSTATUS +NTAPI +SamrSetSecurityObject(IN SAMPR_HANDLE ObjectHandle, + IN SECURITY_INFORMATION SecurityInformation, + IN PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 3 */ +NTSTATUS +NTAPI +SamrQuerySecurityObject(IN SAMPR_HANDLE ObjectHandle, + IN SECURITY_INFORMATION SecurityInformation, + OUT PSAMPR_SR_SECURITY_DESCRIPTOR * SecurityDescriptor) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 4 */ +NTSTATUS +NTAPI +SamrShutdownSamServer(IN SAMPR_HANDLE ServerHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 5 */ +NTSTATUS +NTAPI +SamrLookupDomainInSamServer(IN SAMPR_HANDLE ServerHandle, + IN PRPC_UNICODE_STRING Name, + OUT PRPC_SID *DomainId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 6 */ +NTSTATUS +NTAPI +SamrEnumerateDomainsInSamServer(IN SAMPR_HANDLE ServerHandle, + IN OUT unsigned long *EnumerationContext, + OUT PSAMPR_ENUMERATION_BUFFER *Buffer, + IN unsigned long PreferedMaximumLength, + OUT unsigned long *CountReturned) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 7 */ +NTSTATUS +NTAPI +SamrOpenDomain(IN SAMPR_HANDLE ServerHandle, + IN ACCESS_MASK DesiredAccess, + IN PRPC_SID DomainId, + OUT SAMPR_HANDLE *DomainHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 8 */ +NTSTATUS +NTAPI +SamrQueryInformationDomain(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_INFORMATION_CLASS DomainInformationClass, + OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 9 */ +NTSTATUS +NTAPI +SamrSetInformationDomain(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_INFORMATION_CLASS DomainInformationClass, + IN PSAMPR_DOMAIN_INFO_BUFFER DomainInformation) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 10 */ +NTSTATUS +NTAPI +SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle, + IN PRPC_UNICODE_STRING Name, + IN ACCESS_MASK DesiredAccess, + OUT SAMPR_HANDLE *GroupHandle, + OUT unsigned long *RelativeId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 10 */ +NTSTATUS +NTAPI +SamrEnumerateGroupsInDomain(IN SAMPR_HANDLE DomainHandle, + IN OUT unsigned long *EnumerationContext, + OUT PSAMPR_ENUMERATION_BUFFER *Buffer, + IN unsigned long PreferedMaximumLength, + OUT unsigned long *CountReturned) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 12 */ +NTSTATUS +__stdcall +SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle, + IN PRPC_UNICODE_STRING Name, + IN ACCESS_MASK DesiredAccess, + OUT SAMPR_HANDLE *UserHandle, + OUT unsigned long *RelativeId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 13 */ +NTSTATUS +__stdcall +SamrEnumerateUsersInDomain(IN SAMPR_HANDLE DomainHandle, + IN OUT unsigned long *EnumerationContext, + IN unsigned long UserAccountControl, + OUT PSAMPR_ENUMERATION_BUFFER *Buffer, + IN unsigned long PreferedMaximumLength, + OUT unsigned long *CountReturned) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 14 */ +NTSTATUS +__stdcall +SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle, + IN PRPC_UNICODE_STRING AccountName, + IN ACCESS_MASK DesiredAccess, + OUT SAMPR_HANDLE *AliasHandle, + OUT unsigned long *RelativeId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 15 */ +NTSTATUS +__stdcall +SamrEnumerateAliasesInDomain(IN SAMPR_HANDLE DomainHandle, + IN OUT unsigned long *EnumerationContext, + OUT PSAMPR_ENUMERATION_BUFFER *Buffer, + IN unsigned long PreferedMaximumLength, + OUT unsigned long *CountReturned) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 16 */ +NTSTATUS +__stdcall +SamrGetAliasMembership(IN SAMPR_HANDLE DomainHandle, + IN PSAMPR_PSID_ARRAY SidArray, + OUT PSAMPR_ULONG_ARRAY Membership) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 17 */ +NTSTATUS +__stdcall +SamrLookupNamesInDomain(IN SAMPR_HANDLE DomainHandle, + IN unsigned long Count, + IN RPC_UNICODE_STRING Names[], + OUT PSAMPR_ULONG_ARRAY RelativeIds, + OUT PSAMPR_ULONG_ARRAY Use) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 18 */ +NTSTATUS +__stdcall +SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle, + IN unsigned long Count, + IN unsigned long *RelativeIds, + OUT PSAMPR_RETURNED_USTRING_ARRAY Names, + OUT PSAMPR_ULONG_ARRAY Use) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 19 */ +NTSTATUS +__stdcall +SamrOpenGroup(IN SAMPR_HANDLE DomainHandle, + IN ACCESS_MASK DesiredAccess, + IN unsigned long GroupId, + OUT SAMPR_HANDLE *GroupHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 20 */ +NTSTATUS +__stdcall +SamrQueryInformationGroup(IN SAMPR_HANDLE GroupHandle, + IN GROUP_INFORMATION_CLASS GroupInformationClass, + OUT PSAMPR_GROUP_INFO_BUFFER *Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 21 */ +NTSTATUS +__stdcall +SamrSetInformationGroup(IN SAMPR_HANDLE GroupHandle, + IN GROUP_INFORMATION_CLASS GroupInformationClass, + IN PSAMPR_GROUP_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 22 */ +NTSTATUS +NTAPI +SamrAddMemberToGroup(IN SAMPR_HANDLE GroupHandle, + IN unsigned long MemberId, + IN unsigned long Attributes) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 21 */ +NTSTATUS +NTAPI +SamrDeleteGroup(IN OUT SAMPR_HANDLE *GroupHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 24 */ +NTSTATUS +NTAPI +SamrRemoveMemberFromGroup(IN SAMPR_HANDLE GroupHandle, + IN unsigned long MemberId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 25 */ +NTSTATUS +NTAPI +SamrGetMembersInGroup(IN SAMPR_HANDLE GroupHandle, + OUT PSAMPR_GET_MEMBERS_BUFFER *Members) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 26 */ +NTSTATUS +NTAPI +SamrSetMemberAttributesOfGroup(IN SAMPR_HANDLE GroupHandle, + IN unsigned long MemberId, + IN unsigned long Attributes) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 27 */ +NTSTATUS +NTAPI +SamrOpenAlias(IN SAMPR_HANDLE DomainHandle, + IN ACCESS_MASK DesiredAccess, + IN unsigned long AliasId, + OUT SAMPR_HANDLE *AliasHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 28 */ +NTSTATUS +NTAPI +SamrQueryInformationAlias(IN SAMPR_HANDLE AliasHandle, + IN ALIAS_INFORMATION_CLASS AliasInformationClass, + OUT PSAMPR_ALIAS_INFO_BUFFER *Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 29 */ +NTSTATUS +NTAPI +SamrSetInformationAlias(IN SAMPR_HANDLE AliasHandle, + IN ALIAS_INFORMATION_CLASS AliasInformationClass, + IN PSAMPR_ALIAS_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 30 */ +NTSTATUS +NTAPI +SamrDeleteAlias(IN OUT SAMPR_HANDLE *AliasHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 31 */ +NTSTATUS +NTAPI +SamrAddMemberToAlias(IN SAMPR_HANDLE AliasHandle, + IN PRPC_SID MemberId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 32 */ +NTSTATUS +NTAPI +SamrRemoveMemberFromAlias(IN SAMPR_HANDLE AliasHandle, + IN PRPC_SID MemberId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 33 */ +NTSTATUS +NTAPI +SamrGetMembersInAlias(IN SAMPR_HANDLE AliasHandle, + OUT PSAMPR_PSID_ARRAY_OUT Members) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 34 */ +NTSTATUS +NTAPI +SamrOpenUser(IN SAMPR_HANDLE DomainHandle, + IN unsigned long DesiredAccess, + IN unsigned long UserId, + OUT SAMPR_HANDLE *UserHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 35 */ +NTSTATUS +NTAPI +SamrDeleteUser(IN OUT SAMPR_HANDLE *UserHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 36 */ +NTSTATUS +NTAPI +SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle, + IN USER_INFORMATION_CLASS UserInformationClass, + OUT PSAMPR_USER_INFO_BUFFER *Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 37 */ +NTSTATUS +NTAPI +SamrSetInformationUser(IN SAMPR_HANDLE UserHandle, + IN USER_INFORMATION_CLASS UserInformationClass, + IN PSAMPR_USER_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 38 */ +NTSTATUS +NTAPI +SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle, + IN unsigned char LmPresent, + IN PENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm, + IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm, + IN unsigned char NtPresent, + IN PENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt, + IN PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt, + IN unsigned char NtCrossEncryptionPresent, + IN PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithNewLm, + IN unsigned char LmCrossEncryptionPresent, + IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 39 */ +NTSTATUS +NTAPI +SamrGetGroupsForUser(IN SAMPR_HANDLE UserHandle, + OUT PSAMPR_GET_GROUPS_BUFFER *Groups) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 40 */ +NTSTATUS +NTAPI +SamrQueryDisplayInformation(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + IN unsigned long Index, + IN unsigned long EntryCount, + IN unsigned long PreferredMaximumLength, + OUT unsigned long *TotalAvailable, + OUT unsigned long *TotalReturned, + OUT PSAMPR_DISPLAY_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 41 */ +NTSTATUS +NTAPI +SamrGetDisplayEnumerationIndex(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + IN PRPC_UNICODE_STRING Prefix, + OUT unsigned long *Index) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 42 */ +NTSTATUS +NTAPI +SamrTestPrivateFunctionsDomain(IN SAMPR_HANDLE DomainHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 43 */ +NTSTATUS +NTAPI +SamrTestPrivateFunctionsUser(IN SAMPR_HANDLE UserHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 44 */ +NTSTATUS +NTAPI +SamrGetUserDomainPasswordInformation(IN SAMPR_HANDLE UserHandle, + OUT PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 45 */ +NTSTATUS +NTAPI +SamrRemoveMemberFromForeignDomain(IN SAMPR_HANDLE DomainHandle, + IN PRPC_SID MemberSid) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 46 */ +NTSTATUS +NTAPI +SamrQueryInformationDomain2(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_INFORMATION_CLASS DomainInformationClass, + OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 47 */ +NTSTATUS +NTAPI +SamrQueryInformationUser2(IN SAMPR_HANDLE UserHandle, + IN USER_INFORMATION_CLASS UserInformationClass, + OUT PSAMPR_USER_INFO_BUFFER *Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 48 */ +NTSTATUS +NTAPI +SamrQueryDisplayInformation2(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + IN unsigned long Index, + IN unsigned long EntryCount, + IN unsigned long PreferredMaximumLength, + OUT unsigned long *TotalAvailable, + OUT unsigned long *TotalReturned, + OUT PSAMPR_DISPLAY_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 49 */ +NTSTATUS +NTAPI +SamrGetDisplayEnumerationIndex2(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + IN PRPC_UNICODE_STRING Prefix, + OUT unsigned long *Index) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 50 */ +NTSTATUS +NTAPI +SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle, + IN PRPC_UNICODE_STRING Name, + IN unsigned long AccountType, + IN unsigned long DesiredAccess, + OUT SAMPR_HANDLE *UserHandle, + OUT unsigned long *GrantedAccess, + OUT unsigned long *RelativeId) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 51 */ +NTSTATUS +NTAPI +SamrQueryDisplayInformation3(IN SAMPR_HANDLE DomainHandle, + IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + IN unsigned long Index, + IN unsigned long EntryCount, + IN unsigned long PreferredMaximumLength, + OUT unsigned long *TotalAvailable, + OUT unsigned long *TotalReturned, + OUT PSAMPR_DISPLAY_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 52 */ +NTSTATUS +NTAPI +SamrAddMultipleMembersToAlias(IN SAMPR_HANDLE AliasHandle, + IN PSAMPR_PSID_ARRAY MembersBuffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 53 */ +NTSTATUS +NTAPI +SamrRemoveMultipleMembersFromAlias(IN SAMPR_HANDLE AliasHandle, + IN PSAMPR_PSID_ARRAY MembersBuffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 54 */ +NTSTATUS +NTAPI +SamrOemChangePasswordUser2(IN handle_t BindingHandle, + IN PRPC_STRING ServerName, + IN PRPC_STRING UserName, + IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm, + IN PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewLm) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 55 */ +NTSTATUS +NTAPI +SamrUnicodeChangePasswordUser2(IN handle_t BindingHandle, + IN PRPC_UNICODE_STRING ServerName, + IN PRPC_UNICODE_STRING UserName, + IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldNt, + IN PENCRYPTED_NT_OWF_PASSWORD OldNtOwfPasswordEncryptedWithNewNt, + IN unsigned char LmPresent, + IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm, + IN PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewNt) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 56 */ +NTSTATUS +NTAPI +SamrGetDomainPasswordInformation(IN handle_t BindingHandle, + IN PRPC_UNICODE_STRING Unused, + OUT PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 57 */ +NTSTATUS +NTAPI +SamrConnect2(IN PSAMPR_SERVER_NAME ServerName, + OUT SAMPR_HANDLE *ServerHandle, + IN ACCESS_MASK DesiredAccess) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 58 */ +NTSTATUS +NTAPI +SamrSetInformationUser2(IN SAMPR_HANDLE UserHandle, + IN USER_INFORMATION_CLASS UserInformationClass, + IN PSAMPR_USER_INFO_BUFFER Buffer) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 59 */ +NTSTATUS +NTAPI +SamrSetBootKeyInformation(IN handle_t BindingHandle) /* FIXME */ +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 60 */ +NTSTATUS +NTAPI +SamrGetBootKeyInformation(IN handle_t BindingHandle) /* FIXME */ +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 61 */ +NTSTATUS +NTAPI +SamrConnect3(IN handle_t BindingHandle) /* FIXME */ +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 62 */ +NTSTATUS +NTAPI +SamrConnect4(IN PSAMPR_SERVER_NAME ServerName, + OUT SAMPR_HANDLE *ServerHandle, + IN unsigned long ClientRevision, + IN ACCESS_MASK DesiredAccess) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 63 */ +NTSTATUS +NTAPI +SamrUnicodeChangePasswordUser3(IN handle_t BindingHandle) /* FIXME */ +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 64 */ +NTSTATUS +NTAPI +SamrConnect5(IN PSAMPR_SERVER_NAME ServerName, + IN ACCESS_MASK DesiredAccess, + IN unsigned long InVersion, + IN SAMPR_REVISION_INFO *InRevisionInfo, + OUT unsigned long *OutVersion, + OUT SAMPR_REVISION_INFO *OutRevisionInfo, + OUT SAMPR_HANDLE *ServerHandle) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 65 */ +NTSTATUS +NTAPI +SamrRidToSid(IN SAMPR_HANDLE ObjectHandle, + IN unsigned long Rid, + OUT PRPC_SID *Sid) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 66 */ +NTSTATUS +NTAPI +SamrSetDSRMPassword(IN handle_t BindingHandle, + IN PRPC_UNICODE_STRING Unused, + IN unsigned long UserId, + IN PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* Function 67 */ +NTSTATUS +NTAPI +SamrValidatePassword(IN handle_t Handle, + IN PASSWORD_POLICY_VALIDATION_TYPE ValidationType, + IN PSAM_VALIDATE_INPUT_ARG InputArg, + OUT PSAM_VALIDATE_OUTPUT_ARG *OutputArg) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* EOF */ Propchange: trunk/reactos/dll/win32/samsrv/samrpc.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/samsrv/samrpc.c ------------------------------------------------------------------------------ svn:keywords = author date id revision Modified: trunk/reactos/dll/win32/samsrv/samsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.c [iso-8859-1] Sun May 20 18:31:10 2012 @@ -19,34 +19,29 @@ /* INCLUDES *****************************************************************/ -#define WIN32_NO_STATUS -#include <windows.h> -#define NTOS_MODE_USER -#include <ndk/umtypes.h> +#include <samsrv.h> -//#include <samsrv.h> - -#define NDEBUG -#include <debug.h> - +WINE_DEFAULT_DEBUG_CHANNEL(samsrv); /* FUNCTIONS ****************************************************************/ -NTSTATUS WINAPI +NTSTATUS +NTAPI SamIInitialize(VOID) { - DPRINT1("SamIInitialize() called\n"); + TRACE("SamIInitialize() called\n"); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } -NTSTATUS WINAPI +NTSTATUS +NTAPI SampInitializeRegistry(VOID) { - DPRINT1("SampInitializeRegistry() called\n"); + TRACE("SampInitializeRegistry() called\n"); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } /* EOF */ Added: trunk/reactos/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.h (added) +++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Sun May 20 18:31:10 2012 @@ -1,0 +1,19 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: Security Account Manager (LSA) Server + * FILE: reactos/dll/win32/samsrv/samsrv.h + * PURPOSE: Common header file + * + * PROGRAMMERS: Eric Kohl + */ + +#define WIN32_NO_STATUS +#include <windows.h> +#define NTOS_MODE_USER +#include <ndk/umtypes.h> + +#include <samsrv/samsrv.h> + +#include "sam_s.h" + +#include <wine/debug.h> Propchange: trunk/reactos/dll/win32/samsrv/samsrv.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/samsrv/samsrv.h ------------------------------------------------------------------------------ svn:keywords = author date id revision Modified: trunk/reactos/dll/win32/samsrv/samsrv.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.sp…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samsrv.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samsrv.spec [iso-8859-1] Sun May 20 18:31:10 2012 @@ -1,73 +1,73 @@ -;SamIAccountRestrictions -;SamIConnect -;SamICreateAccountByRid -;SamIEnumerateAccountRids -;SamIFree_SAMPR_ALIAS_INFO_BUFFER -;SamIFree_SAMPR_DISPLAY_INFO_BUFFER -;SamIFree_SAMPR_DOMAIN_INFO_BUFFER -;SamIFree_SAMPR_ENUMERATION_BUFFER -;SamIFree_SAMPR_GET_GROUPS_BUFFER -;SamIFree_SAMPR_GET_MEMBERS_BUFFER -;SamIFree_SAMPR_GROUP_INFO_BUFFER -;SamIFree_SAMPR_PSID_ARRAY -;SamIFree_SAMPR_RETURNED_USTRING_ARRAY -;SamIFree_SAMPR_SR_SECURITY_DESCRIPTOR -;SamIFree_SAMPR_ULONG_ARRAY -;SamIFree_SAMPR_USER_INFO_BUFFER -;SamIGetPrivateData -;SamIGetSerialNumberDomain +@ stub SamIAccountRestrictions +@ stub SamIConnect +@ stub SamICreateAccountByRid +@ stub SamIEnumerateAccountRids +@ stub SamIFree_SAMPR_ALIAS_INFO_BUFFER +@ stub SamIFree_SAMPR_DISPLAY_INFO_BUFFER +@ stub SamIFree_SAMPR_DOMAIN_INFO_BUFFER +@ stub SamIFree_SAMPR_ENUMERATION_BUFFER +@ stub SamIFree_SAMPR_GET_GROUPS_BUFFER +@ stub SamIFree_SAMPR_GET_MEMBERS_BUFFER +@ stub SamIFree_SAMPR_GROUP_INFO_BUFFER +@ stub SamIFree_SAMPR_PSID_ARRAY +@ stub SamIFree_SAMPR_RETURNED_USTRING_ARRAY +@ stub SamIFree_SAMPR_SR_SECURITY_DESCRIPTOR +@ stub SamIFree_SAMPR_ULONG_ARRAY +@ stub SamIFree_SAMPR_USER_INFO_BUFFER +@ stub SamIGetPrivateData +@ stub SamIGetSerialNumberDomain @ stdcall SamIInitialize() -;SamINotifyDelta -;SamISetAuditingInformation -;SamISetPrivateData -;SamISetSerialNumberDomain +@ stub SamINotifyDelta +@ stub SamISetAuditingInformation +@ stub SamISetPrivateData +@ stub SamISetSerialNumberDomain @ stdcall SampInitializeRegistry() -;SampRtlConvertUlongToUnicodeString -;SamrAddMemberToAlias -;SamrAddMemberToGroup -;SamrAddMultipleMemberstoAlias -;SamrChangePasswordUser -;SamrCloseHandle -;SamrConnect -;SamrCreateAliasInDomain -;SamrCreateGroupInDomain -;SamrCreateUserInDomain -;SamrDeleteAlias -;SamrDeleteGroup -;SamrDeleteUser -;SamrEnumerateAliasesInDomain -;SamrEnumerateDomainsInSamServer -;SamrEnumerateGroupsInDomain -;SamrEnumerateUsersInDomain -;SamrGetAliasMembership -;SamrGetGroupsForUser -;SamrGetMembersInAlias -;SamrGetMembersInGroup -;SamrGetUserDomainPasswordInformation -;SamrLookupDomainInSamServer -;SamrLookupIdsInDomain -;SamrLookupNamesInDomain -;SamrOpenAlias -;SamrOpenDomain -;SamrOpenGroup -;SamrOpenUser -;SamrQueryDisplayInformation -;SamrQueryInformationAlias -;SamrQueryInformationDomain -;SamrQueryInformationGroup -;SamrQueryInformationUser -;SamrQuerySecurityObject -;SamrRemoveMemberFromAlias -;SamrRemoveMemberFromForeignDomain -;SamrRemoveMemberFromGroup -;SamrRemoveMultipleMembersFromAlias -;SamrSetInformationAlias -;SamrSetInformationDomain -;SamrSetInformationGroup -;SamrSetInformationUser -;SamrSetMemberAttributesOfGroup -;SamrSetSecurityObject -;SamrShutdownSamServer -;SamrTestPrivateFunctionsDomain -;SamrTestPrivateFunctionsUser +@ stub SampRtlConvertUlongToUnicodeString +@ stdcall SamrAddMemberToAlias(ptr ptr) +@ stdcall SamrAddMemberToGroup(ptr long long) +@ stdcall SamrAddMultipleMembersToAlias(ptr ptr) +@ stdcall SamrChangePasswordUser(ptr long ptr ptr long ptr ptr long ptr long ptr) +@ stdcall SamrCloseHandle(ptr) +@ stdcall SamrConnect(ptr ptr long) +@ stdcall SamrCreateAliasInDomain(ptr ptr long ptr ptr) +@ stdcall SamrCreateGroupInDomain(ptr ptr long ptr ptr) +@ stdcall SamrCreateUserInDomain(ptr ptr long ptr ptr) +@ stdcall SamrDeleteAlias(ptr) +@ stdcall SamrDeleteGroup(ptr) +@ stdcall SamrDeleteUser(ptr) +@ stdcall SamrEnumerateAliasesInDomain(ptr ptr ptr long ptr) +@ stdcall SamrEnumerateDomainsInSamServer(ptr ptr ptr long ptr) +@ stdcall SamrEnumerateGroupsInDomain(ptr ptr ptr long ptr) +@ stdcall SamrEnumerateUsersInDomain(ptr ptr long ptr long ptr) +@ stdcall SamrGetAliasMembership(ptr ptr ptr) +@ stdcall SamrGetGroupsForUser(ptr ptr) +@ stdcall SamrGetMembersInAlias(ptr ptr) +@ stdcall SamrGetMembersInGroup(ptr ptr) +@ stdcall SamrGetUserDomainPasswordInformation(ptr ptr) +@ stdcall SamrLookupDomainInSamServer(ptr ptr ptr) +@ stdcall SamrLookupIdsInDomain(ptr long ptr ptr ptr) +@ stdcall SamrLookupNamesInDomain(ptr long ptr ptr ptr) +@ stdcall SamrOpenAlias(ptr long long ptr) +@ stdcall SamrOpenDomain(ptr long ptr ptr) +@ stdcall SamrOpenGroup(ptr long long ptr) +@ stdcall SamrOpenUser(ptr long long ptr) +@ stdcall SamrQueryDisplayInformation(ptr long long long long ptr ptr ptr) +@ stdcall SamrQueryInformationAlias(ptr long ptr) +@ stdcall SamrQueryInformationDomain(ptr long ptr) +@ stdcall SamrQueryInformationGroup(ptr long ptr) +@ stdcall SamrQueryInformationUser(ptr long ptr) +@ stdcall SamrQuerySecurityObject(ptr long ptr) +@ stdcall SamrRemoveMemberFromAlias(ptr ptr) +@ stdcall SamrRemoveMemberFromForeignDomain(ptr ptr) +@ stdcall SamrRemoveMemberFromGroup(ptr long) +@ stdcall SamrRemoveMultipleMembersFromAlias(ptr ptr) +@ stdcall SamrSetInformationAlias(ptr long ptr) +@ stdcall SamrSetInformationDomain(ptr long ptr) +@ stdcall SamrSetInformationGroup(ptr long ptr) +@ stdcall SamrSetInformationUser(ptr long ptr) +@ stdcall SamrSetMemberAttributesOfGroup(ptr long long) +@ stdcall SamrSetSecurityObject(ptr long ptr) +@ stdcall SamrShutdownSamServer(ptr) +@ stdcall SamrTestPrivateFunctionsDomain(ptr) +@ stdcall SamrTestPrivateFunctionsUser(ptr) ; EOF Propchange: trunk/reactos/include/reactos/libs/samsrv/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sun May 20 18:31:10 2012 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/include/reactos/libs/samsrv/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/include/reactos/libs/samsrv/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/include/reactos/libs/samsrv/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/include/reactos/libs/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/samsr…
============================================================================== --- trunk/reactos/include/reactos/libs/samsrv/samsrv.h (added) +++ trunk/reactos/include/reactos/libs/samsrv/samsrv.h [iso-8859-1] Sun May 20 18:31:10 2012 @@ -1,0 +1,13 @@ +#ifndef __SAMSRV__ +#define __SAMSRV__ + +NTSTATUS +NTAPI +SamIInitialize(VOID); + +NTSTATUS +NTAPI +SampInitializeRegistry(VOID); + + +#endif /* __SAMSRV__ */ Propchange: trunk/reactos/include/reactos/libs/samsrv/samsrv.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/include/reactos/libs/samsrv/samsrv.h ------------------------------------------------------------------------------ svn:keywords = author date id revision
12 years, 7 months
1
0
0
0
[ekohl] 56644: [IDL] Add ACF and IDL file for the SAM RPC interface.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 20 16:32:24 2012 New Revision: 56644 URL:
http://svn.reactos.org/svn/reactos?rev=56644&view=rev
Log: [IDL] Add ACF and IDL file for the SAM RPC interface. Added: trunk/reactos/include/reactos/idl/sam.acf (with props) trunk/reactos/include/reactos/idl/sam.idl (with props) Added: trunk/reactos/include/reactos/idl/sam.acf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/sam.ac…
============================================================================== --- trunk/reactos/include/reactos/idl/sam.acf (added) +++ trunk/reactos/include/reactos/idl/sam.acf [iso-8859-1] Sun May 20 16:32:24 2012 @@ -1,0 +1,6 @@ +[ + explicit_handle +] +interface samr +{ +} Propchange: trunk/reactos/include/reactos/idl/sam.acf ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/reactos/idl/sam.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/sam.id…
============================================================================== --- trunk/reactos/include/reactos/idl/sam.idl (added) +++ trunk/reactos/include/reactos/idl/sam.idl [iso-8859-1] Sun May 20 16:32:24 2012 @@ -1,0 +1,1361 @@ +/* + * Security Account Manager interface definition + */ + +#include <ms-dtyp.idl> + +cpp_quote("#ifndef _NTDEF_") +typedef long NTSTATUS; +cpp_quote("#endif") + +typedef struct _RPC_STRING +{ + unsigned short Length; + unsigned short MaximumLength; + [size_is(MaximumLength), length_is(Length)] char *Buffer; +} RPC_STRING, *PRPC_STRING; + +typedef struct _OLD_LARGE_INTEGER +{ + unsigned long LowPart; + long HighPart; +} OLD_LARGE_INTEGER, *POLD_LARGE_INTEGER; + +typedef [handle] wchar_t *PSAMPR_SERVER_NAME; + +typedef [context_handle] void *SAMPR_HANDLE; + +typedef struct _ENCRYPTED_LM_OWF_PASSWORD +{ + char data[16]; +} ENCRYPTED_LM_OWF_PASSWORD, *PENCRYPTED_LM_OWF_PASSWORD, ENCRYPTED_NT_OWF_PASSWORD, *PENCRYPTED_NT_OWF_PASSWORD; + +typedef struct _SAMPR_ULONG_ARRAY +{ + unsigned long Count; + [size_is(Count)] unsigned long *Element; +} SAMPR_ULONG_ARRAY, *PSAMPR_ULONG_ARRAY; + +typedef struct _SAMPR_SID_INFORMATION +{ + PRPC_SID SidPointer; +} SAMPR_SID_INFORMATION, *PSAMPR_SID_INFORMATION; + +typedef struct _SAMPR_PSID_ARRAY +{ + [range(0, 1024)] unsigned long Count; + [size_is(Count)] PSAMPR_SID_INFORMATION Sids; +} SAMPR_PSID_ARRAY, *PSAMPR_PSID_ARRAY; + +typedef struct _SAMPR_PSID_ARRAY_OUT +{ + unsigned long Count; + [size_is(Count)] PSAMPR_SID_INFORMATION Sids; +} SAMPR_PSID_ARRAY_OUT, *PSAMPR_PSID_ARRAY_OUT; + +typedef struct _SAMPR_RETURNED_USTRING_ARRAY +{ + unsigned long Count; + [size_is(Count)] PRPC_UNICODE_STRING Element; +} SAMPR_RETURNED_USTRING_ARRAY, *PSAMPR_RETURNED_USTRING_ARRAY; + +cpp_quote("#ifndef _WINNT_H") +typedef enum _SID_NAME_USE +{ + SidTypeUser = 1, + SidTypeGroup, + SidTypeDomain, + SidTypeAlias, + SidTypeWellKnownGroup, + SidTypeDeletedAccount, + SidTypeInvalid, + SidTypeUnknown, +} SID_NAME_USE, *PSID_NAME_USE; +cpp_quote("#endif") + +typedef struct RPC_SHORT_BLOB +{ + unsigned short Length; + unsigned short MaximumLength; + [size_is(MaximumLength/2), length_is(Length/2)] + unsigned short* Buffer; +} RPC_SHORT_BLOB, *PRPC_SHORT_BLOB; + +typedef struct _SAMPR_RID_ENUMERATION +{ + unsigned long RelativeId; + RPC_UNICODE_STRING Name; +} SAMPR_RID_ENUMERATION, *PSAMPR_RID_ENUMERATION; + +typedef struct _SAMPR_ENUMERATION_BUFFER +{ + unsigned long EntriesRead; + [size_is(EntriesRead)] PSAMPR_RID_ENUMERATION Buffer; +} SAMPR_ENUMERATION_BUFFER, *PSAMPR_ENUMERATION_BUFFER; + +typedef struct _SAMPR_SR_SECURITY_DESCRIPTOR +{ + [range(0, 256 * 1024)] unsigned long Length; + [size_is(Length)] unsigned char* SecurityDescriptor; +} SAMPR_SR_SECURITY_DESCRIPTOR, *PSAMPR_SR_SECURITY_DESCRIPTOR; + +typedef struct _GROUP_MEMBERSHIP +{ + unsigned long RelativeId; + unsigned long Attributes; +} GROUP_MEMBERSHIP, *PGROUP_MEMBERSHIP; + +typedef struct _SAMPR_GET_GROUPS_BUFFER +{ + unsigned long MembershipCount; + [size_is(MembershipCount)] PGROUP_MEMBERSHIP Groups; +} SAMPR_GET_GROUPS_BUFFER, *PSAMPR_GET_GROUPS_BUFFER; + +typedef struct _SAMPR_GET_MEMBERS_BUFFER +{ + unsigned long MemberCount; + [size_is(MemberCount)] unsigned long* Members; + [size_is(MemberCount)] unsigned long* Attributes; +} SAMPR_GET_MEMBERS_BUFFER, *PSAMPR_GET_MEMBERS_BUFFER; + +typedef struct _SAMPR_REVISION_INFO_V1 +{ + unsigned long Revision; + unsigned long SupportedFeatures; +} SAMPR_REVISION_INFO_V1, *PSAMPR_REVISION_INFO_V1; + +typedef [switch_type(unsigned long)] union +{ + [case(1)] SAMPR_REVISION_INFO_V1 V1; +}SAMPR_REVISION_INFO, *PSAMPR_REVISION_INFO; + +typedef struct _USER_DOMAIN_PASSWORD_INFORMATION +{ + unsigned short MinPasswordLength; + unsigned long PasswordProperties; +} USER_DOMAIN_PASSWORD_INFORMATION, *PUSER_DOMAIN_PASSWORD_INFORMATION; + +typedef enum _DOMAIN_SERVER_ENABLE_STATE +{ + DomainServerEnabled = 1, + DomainServerDisabled +} DOMAIN_SERVER_ENABLE_STATE, *PDOMAIN_SERVER_ENABLE_STATE; + +typedef struct _DOMAIN_STATE_INFORMATION +{ + DOMAIN_SERVER_ENABLE_STATE DomainServerState; +} DOMAIN_STATE_INFORMATION, *PDOMAIN_STATE_INFORMATION; + +typedef enum _DOMAIN_SERVER_ROLE +{ + DomainServerRoleBackup = 2, + DomainServerRolePrimary = 3 +} DOMAIN_SERVER_ROLE, *PDOMAIN_SERVER_ROLE; + +typedef struct _DOMAIN_PASSWORD_INFORMATION +{ + unsigned short MinPasswordLength; + unsigned short PasswordHistoryLength; + unsigned long PasswordProperties; + OLD_LARGE_INTEGER MaxPasswordAge; + OLD_LARGE_INTEGER MinPasswordAge; +} DOMAIN_PASSWORD_INFORMATION, *PDOMAIN_PASSWORD_INFORMATION; + +typedef struct _DOMAIN_LOGOFF_INFORMATION +{ + OLD_LARGE_INTEGER ForceLogoff; +} DOMAIN_LOGOFF_INFORMATION, *PDOMAIN_LOGOFF_INFORMATION; + +typedef struct _DOMAIN_SERVER_ROLE_INFORMATION +{ + DOMAIN_SERVER_ROLE DomainServerRole; +} DOMAIN_SERVER_ROLE_INFORMATION, *PDOMAIN_SERVER_ROLE_INFORMATION; + +typedef struct _DOMAIN_MODIFIED_INFORMATION +{ + OLD_LARGE_INTEGER DomainModifiedCount; + OLD_LARGE_INTEGER CreationTime; +} DOMAIN_MODIFIED_INFORMATION, *PDOMAIN_MODIFIED_INFORMATION; + +typedef struct _DOMAIN_MODIFIED_INFORMATION2 +{ + OLD_LARGE_INTEGER DomainModifiedCount; + OLD_LARGE_INTEGER CreationTime; + OLD_LARGE_INTEGER ModifiedCountAtLastPromotion; +} DOMAIN_MODIFIED_INFORMATION2, *PDOMAIN_MODIFIED_INFORMATION2; + +cpp_quote("#include <pshpack4.h>") +typedef struct _SAMPR_DOMAIN_GENERAL_INFORMATION +{ + OLD_LARGE_INTEGER ForceLogoff; + RPC_UNICODE_STRING OemInformation; + RPC_UNICODE_STRING DomainName; + RPC_UNICODE_STRING ReplicaSourceNodeName; + OLD_LARGE_INTEGER DomainModifiedCount; + unsigned long DomainServerState; + unsigned long DomainServerRole; + unsigned char UasCompatibilityRequired; + unsigned long UserCount; + unsigned long GroupCount; + unsigned long AliasCount; +} SAMPR_DOMAIN_GENERAL_INFORMATION, *PSAMPR_DOMAIN_GENERAL_INFORMATION; + +typedef struct _SAMPR_DOMAIN_GENERAL_INFORMATION2 +{ + SAMPR_DOMAIN_GENERAL_INFORMATION I1; + LARGE_INTEGER LockoutDuration; + LARGE_INTEGER LockoutObservationWindow; + unsigned short LockoutThreshold; +} SAMPR_DOMAIN_GENERAL_INFORMATION2, *PSAMPR_DOMAIN_GENERAL_INFORMATION2; +cpp_quote("#include <poppack.h>") + +typedef struct _SAMPR_DOMAIN_OEM_INFORMATION +{ + RPC_UNICODE_STRING OemInformation; +} SAMPR_DOMAIN_OEM_INFORMATION, *PSAMPR_DOMAIN_OEM_INFORMATION; + +typedef struct _SAMPR_DOMAIN_NAME_INFORMATION +{ + RPC_UNICODE_STRING DomainName; +} SAMPR_DOMAIN_NAME_INFORMATION, *PSAMPR_DOMAIN_NAME_INFORMATION; + +typedef struct SAMPR_DOMAIN_REPLICATION_INFORMATION +{ + RPC_UNICODE_STRING ReplicaSourceNodeName; +} SAMPR_DOMAIN_REPLICATION_INFORMATION, *PSAMPR_DOMAIN_REPLICATION_INFORMATION; + +typedef struct _SAMPR_DOMAIN_LOCKOUT_INFORMATION +{ + LARGE_INTEGER LockoutDuration; + LARGE_INTEGER LockoutObservationWindow; + unsigned short LockoutThreshold; +} SAMPR_DOMAIN_LOCKOUT_INFORMATION, *PSAMPR_DOMAIN_LOCKOUT_INFORMATION; + +typedef enum _DOMAIN_INFORMATION_CLASS +{ + DomainPasswordInformation = 1, + DomainGeneralInformation = 2, + DomainLogoffInformation = 3, + DomainOemInformation = 4, + DomainNameInformation = 5, + DomainReplicationInformation = 6, + DomainServerRoleInformation = 7, + DomainModifiedInformation = 8, + DomainStateInformation = 9, + DomainGeneralInformation2 = 11, + DomainLockoutInformation = 12, + DomainModifiedInformation2 = 13 +} DOMAIN_INFORMATION_CLASS; + +typedef [switch_type(DOMAIN_INFORMATION_CLASS)] union _SAMPR_DOMAIN_INFO_BUFFER +{ + [case(DomainPasswordInformation)] DOMAIN_PASSWORD_INFORMATION Password; + [case(DomainGeneralInformation)] SAMPR_DOMAIN_GENERAL_INFORMATION General; + [case(DomainLogoffInformation)] DOMAIN_LOGOFF_INFORMATION Logoff; + [case(DomainOemInformation)] SAMPR_DOMAIN_OEM_INFORMATION Oem; + [case(DomainNameInformation)] SAMPR_DOMAIN_NAME_INFORMATION Name; + [case(DomainServerRoleInformation)] DOMAIN_SERVER_ROLE_INFORMATION Role; + [case(DomainReplicationInformation)] SAMPR_DOMAIN_REPLICATION_INFORMATION Replication; + [case(DomainModifiedInformation)] DOMAIN_MODIFIED_INFORMATION Modified; + [case(DomainStateInformation)] DOMAIN_STATE_INFORMATION State; + [case(DomainGeneralInformation2)] SAMPR_DOMAIN_GENERAL_INFORMATION2 General2; + [case(DomainLockoutInformation)] SAMPR_DOMAIN_LOCKOUT_INFORMATION Lockout; + [case(DomainModifiedInformation2)] DOMAIN_MODIFIED_INFORMATION2 Modified2; +} SAMPR_DOMAIN_INFO_BUFFER, *PSAMPR_DOMAIN_INFO_BUFFER; + +typedef enum _DOMAIN_DISPLAY_INFORMATION +{ + DomainDisplayUser = 1, + DomainDisplayMachine, + DomainDisplayGroup, + DomainDisplayOemUser, + DomainDisplayOemGroup +} DOMAIN_DISPLAY_INFORMATION, *PDOMAIN_DISPLAY_INFORMATION; + +typedef struct _SAMPR_DOMAIN_DISPLAY_USER +{ + unsigned long Index; + unsigned long Rid; + unsigned long AccountControl; + RPC_UNICODE_STRING AccountName; + RPC_UNICODE_STRING AdminComment; + RPC_UNICODE_STRING FullName; +} SAMPR_DOMAIN_DISPLAY_USER, *PSAMPR_DOMAIN_DISPLAY_USER; + +typedef struct _SAMPR_DOMAIN_DISPLAY_MACHINE +{ + unsigned long Index; + unsigned long Rid; + unsigned long AccountControl; + RPC_UNICODE_STRING AccountName; + RPC_UNICODE_STRING AdminComment; +} SAMPR_DOMAIN_DISPLAY_MACHINE, *PSAMPR_DOMAIN_DISPLAY_MACHINE; + +typedef struct _SAMPR_DOMAIN_DISPLAY_GROUP +{ + unsigned long Index; + unsigned long Rid; + unsigned long Attributes; + RPC_UNICODE_STRING AccountName; + RPC_UNICODE_STRING AdminComment; +} SAMPR_DOMAIN_DISPLAY_GROUP, *PSAMPR_DOMAIN_DISPLAY_GROUP; + +typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_USER +{ + unsigned long Index; + RPC_STRING OemAccountName; +} SAMPR_DOMAIN_DISPLAY_OEM_USER, *PSAMPR_DOMAIN_DISPLAY_OEM_USER; + +typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_GROUP +{ + unsigned long Index; + RPC_STRING OemAccountName; +} SAMPR_DOMAIN_DISPLAY_OEM_GROUP, *PSAMPR_DOMAIN_DISPLAY_OEM_GROUP; + +typedef struct _SAMPR_DOMAIN_DISPLAY_USER_BUFFER +{ + unsigned long EntriesRead; + [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_USER Buffer; +} SAMPR_DOMAIN_DISPLAY_USER_BUFFER, *PSAMPR_DOMAIN_DISPLAY_USER_BUFFER; + +typedef struct _SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER +{ + unsigned long EntriesRead; + [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_MACHINE Buffer; +} SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER, *PSAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER; + +typedef struct _SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER +{ + unsigned long EntriesRead; + [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_GROUP Buffer; +} SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER, *PSAMPR_DOMAIN_DISPLAY_GROUP_BUFFER; + +typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER +{ + unsigned long EntriesRead; + [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_OEM_USER Buffer; +} SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER, *PSAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER; + +typedef struct _SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER +{ + unsigned long EntriesRead; + [size_is(EntriesRead)] PSAMPR_DOMAIN_DISPLAY_OEM_GROUP Buffer; +} SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER, *PSAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER; + +typedef [switch_type(DOMAIN_DISPLAY_INFORMATION)] union _SAMPR_DISPLAY_INFO_BUFFER +{ + [case(DomainDisplayUser)] SAMPR_DOMAIN_DISPLAY_USER_BUFFER UserInformation; + [case(DomainDisplayMachine)] SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER MachineInformation; + [case(DomainDisplayGroup)] SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER GroupInformation; + [case(DomainDisplayOemUser)] SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER OemUserInformation; + [case(DomainDisplayOemGroup)] SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER OemGroupInformation; +} SAMPR_DISPLAY_INFO_BUFFER, *PSAMPR_DISPLAY_INFO_BUFFER; + +typedef struct _GROUP_ATTRIBUTE_INFORMATION +{ + unsigned long Attributes; +} GROUP_ATTRIBUTE_INFORMATION, *PGROUP_ATTRIBUTE_INFORMATION; + +typedef struct _SAMPR_GROUP_GENERAL_INFORMATION +{ + RPC_UNICODE_STRING Name; + unsigned long Attributes; + unsigned long MemberCount; + RPC_UNICODE_STRING AdminComment; +} SAMPR_GROUP_GENERAL_INFORMATION, *PSAMPR_GROUP_GENERAL_INFORMATION; + +typedef struct _SAMPR_GROUP_NAME_INFORMATION +{ + RPC_UNICODE_STRING Name; +} SAMPR_GROUP_NAME_INFORMATION, *PSAMPR_GROUP_NAME_INFORMATION; + +typedef struct _SAMPR_GROUP_ADM_COMMENT_INFORMATION +{ + RPC_UNICODE_STRING AdminComment; +} SAMPR_GROUP_ADM_COMMENT_INFORMATION, *PSAMPR_GROUP_ADM_COMMENT_INFORMATION; + +typedef enum _GROUP_INFORMATION_CLASS +{ + GroupGeneralInformation = 1, + GroupNameInformation, + GroupAttributeInformation, + GroupAdminCommentInformation, + GroupReplicationInformation +} GROUP_INFORMATION_CLASS; + +typedef [switch_type(GROUP_INFORMATION_CLASS)] union _SAMPR_GROUP_INFO_BUFFER +{ + [case(GroupGeneralInformation)] SAMPR_GROUP_GENERAL_INFORMATION General; + [case(GroupNameInformation)] SAMPR_GROUP_NAME_INFORMATION Name; + [case(GroupAttributeInformation)] GROUP_ATTRIBUTE_INFORMATION Attribute; + [case(GroupAdminCommentInformation)] SAMPR_GROUP_ADM_COMMENT_INFORMATION AdminComment; + [case(GroupReplicationInformation)] SAMPR_GROUP_GENERAL_INFORMATION DoNotUse; +} SAMPR_GROUP_INFO_BUFFER, *PSAMPR_GROUP_INFO_BUFFER; + +typedef struct _SAMPR_ALIAS_GENERAL_INFORMATION +{ + RPC_UNICODE_STRING Name; + unsigned long MemberCount; + RPC_UNICODE_STRING AdminComment; +} SAMPR_ALIAS_GENERAL_INFORMATION, *PSAMPR_ALIAS_GENERAL_INFORMATION; + +typedef struct _SAMPR_ALIAS_NAME_INFORMATION +{ + RPC_UNICODE_STRING Name; +} SAMPR_ALIAS_NAME_INFORMATION, *PSAMPR_ALIAS_NAME_INFORMATION; + +typedef struct _SAMPR_ALIAS_ADM_COMMENT_INFORMATION +{ + RPC_UNICODE_STRING AdminComment; +} SAMPR_ALIAS_ADM_COMMENT_INFORMATION, *PSAMPR_ALIAS_ADM_COMMENT_INFORMATION; + +typedef enum _ALIAS_INFORMATION_CLASS +{ + AliasGeneralInformation = 1, + AliasNameInformation, + AliasAdminCommentInformation, +} ALIAS_INFORMATION_CLASS; + +typedef [switch_type(ALIAS_INFORMATION_CLASS)] union _SAMPR_ALIAS_INFO_BUFFER +{ + [case(AliasGeneralInformation)] SAMPR_ALIAS_GENERAL_INFORMATION General; + [case(AliasNameInformation)] SAMPR_ALIAS_NAME_INFORMATION Name; + [case(AliasAdminCommentInformation)] SAMPR_ALIAS_ADM_COMMENT_INFORMATION AdminComment; +} SAMPR_ALIAS_INFO_BUFFER, *PSAMPR_ALIAS_INFO_BUFFER; + +typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD +{ + unsigned char Buffer[(256 * 2) + 4]; +} SAMPR_ENCRYPTED_USER_PASSWORD, *PSAMPR_ENCRYPTED_USER_PASSWORD; + +typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD_NEW +{ + unsigned char Buffer[(256 * 2) + 4 + 16]; +} SAMPR_ENCRYPTED_USER_PASSWORD_NEW, *PSAMPR_ENCRYPTED_USER_PASSWORD_NEW; + +typedef struct _USER_PRIMARY_GROUP_INFORMATION +{ + unsigned long PrimaryGroupId; +} USER_PRIMARY_GROUP_INFORMATION, *PUSER_PRIMARY_GROUP_INFORMATION; + +typedef struct _USER_CONTROL_INFORMATION +{ + unsigned long UserAccountControl; +} USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION; + +typedef struct _USER_EXPIRES_INFORMATION +{ + OLD_LARGE_INTEGER AccountExpires; +} USER_EXPIRES_INFORMATION, *PUSER_EXPIRES_INFORMATION; + +typedef struct _SAMPR_LOGON_HOURS +{ + unsigned short UnitsPerWeek; +// [size_is(1260), length_is((UnitsPerWeek + 7) / 8)] unsigned char *LogonHours; // FIXME + [size_is(1260)] unsigned char *LogonHours; +} SAMPR_LOGON_HOURS, *PSAMPR_LOGON_HOURS; + +typedef struct _SAMPR_USER_ALL_INFORMATION +{ + OLD_LARGE_INTEGER LastLogon; + OLD_LARGE_INTEGER LastLogoff; + OLD_LARGE_INTEGER PasswordLastSet; + OLD_LARGE_INTEGER AccountExpires; + OLD_LARGE_INTEGER PasswordCanChange; + OLD_LARGE_INTEGER PasswordMustChange; + RPC_UNICODE_STRING UserName; + RPC_UNICODE_STRING FullName; + RPC_UNICODE_STRING HomeDirectory; + RPC_UNICODE_STRING HomeDirectoryDrive; + RPC_UNICODE_STRING ScriptPath; + RPC_UNICODE_STRING ProfilePath; + RPC_UNICODE_STRING AdminComment; + RPC_UNICODE_STRING WorkStations; + RPC_UNICODE_STRING UserComment; + RPC_UNICODE_STRING Parameters; + RPC_SHORT_BLOB LmOwfPassword; + RPC_SHORT_BLOB NtOwfPassword; + RPC_UNICODE_STRING PrivateData; + SAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor; + unsigned long UserId; + unsigned long PrimaryGroupId; + unsigned long UserAccountControl; + unsigned long WhichFields; + SAMPR_LOGON_HOURS LogonHours; + unsigned short BadPasswordCount; + unsigned short LogonCount; + unsigned short CountryCode; + unsigned short CodePage; + unsigned char LmPasswordPresent; + unsigned char NtPasswordPresent; + unsigned char PasswordExpired; + unsigned char PrivateDataSensitive; +} SAMPR_USER_ALL_INFORMATION, *PSAMPR_USER_ALL_INFORMATION; + +typedef struct _SAMPR_USER_GENERAL_INFORMATION +{ + RPC_UNICODE_STRING UserName; + RPC_UNICODE_STRING FullName; + unsigned long PrimaryGroupId; + RPC_UNICODE_STRING AdminComment; + RPC_UNICODE_STRING UserComment; +} SAMPR_USER_GENERAL_INFORMATION, *PSAMPR_USER_GENERAL_INFORMATION; + +typedef struct _SAMPR_USER_PREFERENCES_INFORMATION +{ + RPC_UNICODE_STRING UserComment; + RPC_UNICODE_STRING Reserved1; + unsigned short CountryCode; + unsigned short CodePage; +} SAMPR_USER_PREFERENCES_INFORMATION, *PSAMPR_USER_PREFERENCES_INFORMATION; + +typedef struct _SAMPR_USER_PARAMETERS_INFORMATION +{ + RPC_UNICODE_STRING Parameters; +} SAMPR_USER_PARAMETERS_INFORMATION, *PSAMPR_USER_PARAMETERS_INFORMATION; + +typedef struct _SAMPR_USER_LOGON_INFORMATION +{ + RPC_UNICODE_STRING UserName; + RPC_UNICODE_STRING FullName; + unsigned long UserId; + unsigned long PrimaryGroupId; + RPC_UNICODE_STRING HomeDirectory; + RPC_UNICODE_STRING HomeDirectoryDrive; + RPC_UNICODE_STRING ScriptPath; + RPC_UNICODE_STRING ProfilePath; + RPC_UNICODE_STRING WorkStations; + OLD_LARGE_INTEGER LastLogon; + OLD_LARGE_INTEGER LastLogoff; + OLD_LARGE_INTEGER PasswordLastSet; + OLD_LARGE_INTEGER PasswordCanChange; + OLD_LARGE_INTEGER PasswordMustChange; + SAMPR_LOGON_HOURS LogonHours; + unsigned short BadPasswordCount; + unsigned short LogonCount; + unsigned long UserAccountControl; +} SAMPR_USER_LOGON_INFORMATION, *PSAMPR_USER_LOGON_INFORMATION; + +typedef struct _SAMPR_USER_ACCOUNT_INFORMATION +{ + RPC_UNICODE_STRING UserName; + RPC_UNICODE_STRING FullName; + unsigned long UserId; + unsigned long PrimaryGroupId; + RPC_UNICODE_STRING HomeDirectory; + RPC_UNICODE_STRING HomeDirectoryDrive; + RPC_UNICODE_STRING ScriptPath; + RPC_UNICODE_STRING ProfilePath; + RPC_UNICODE_STRING AdminComment; + RPC_UNICODE_STRING WorkStations; + OLD_LARGE_INTEGER LastLogon; + OLD_LARGE_INTEGER LastLogoff; + SAMPR_LOGON_HOURS LogonHours; + unsigned short BadPasswordCount; + unsigned short LogonCount; + OLD_LARGE_INTEGER PasswordLastSet; + OLD_LARGE_INTEGER AccountExpires; + unsigned long UserAccountControl; +} SAMPR_USER_ACCOUNT_INFORMATION, *PSAMPR_USER_ACCOUNT_INFORMATION; + +typedef struct _SAMPR_USER_A_NAME_INFORMATION +{ + RPC_UNICODE_STRING UserName; +} SAMPR_USER_A_NAME_INFORMATION, *PSAMPR_USER_A_NAME_INFORMATION; + +typedef struct _SAMPR_USER_F_NAME_INFORMATION +{ + RPC_UNICODE_STRING FullName; +} SAMPR_USER_F_NAME_INFORMATION, *PSAMPR_USER_F_NAME_INFORMATION; + +typedef struct _SAMPR_USER_NAME_INFORMATION +{ + RPC_UNICODE_STRING UserName; + RPC_UNICODE_STRING FullName; +} SAMPR_USER_NAME_INFORMATION, *PSAMPR_USER_NAME_INFORMATION; + +typedef struct _SAMPR_USER_HOME_INFORMATION +{ + RPC_UNICODE_STRING HomeDirectory; + RPC_UNICODE_STRING HomeDirectoryDrive; +} SAMPR_USER_HOME_INFORMATION, *PSAMPR_USER_HOME_INFORMATION; + +typedef struct _SAMPR_USER_SCRIPT_INFORMATION +{ + RPC_UNICODE_STRING ScriptPath; +} SAMPR_USER_SCRIPT_INFORMATION, *PSAMPR_USER_SCRIPT_INFORMATION; + +typedef struct _SAMPR_USER_PROFILE_INFORMATION +{ + RPC_UNICODE_STRING ProfilePath; +} SAMPR_USER_PROFILE_INFORMATION, *PSAMPR_USER_PROFILE_INFORMATION; + +typedef struct _SAMPR_USER_ADMIN_COMMENT_INFORMATION +{ + RPC_UNICODE_STRING AdminComment; +} SAMPR_USER_ADMIN_COMMENT_INFORMATION, *PSAMPR_USER_ADMIN_COMMENT_INFORMATION; + +typedef struct _SAMPR_USER_WORKSTATIONS_INFORMATION +{ + RPC_UNICODE_STRING WorkStations; +} SAMPR_USER_WORKSTATIONS_INFORMATION, *PSAMPR_USER_WORKSTATIONS_INFORMATION; + +typedef struct _SAMPR_USER_LOGON_HOURS_INFORMATION +{ + SAMPR_LOGON_HOURS LogonHours; +} SAMPR_USER_LOGON_HOURS_INFORMATION, *PSAMPR_USER_LOGON_HOURS_INFORMATION; + +typedef struct _SAMPR_USER_INTERNAL1_INFORMATION +{ + ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword; + ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword; + unsigned char NtPasswordPresent; + unsigned char LmPasswordPresent; + unsigned char PasswordExpired; +} SAMPR_USER_INTERNAL1_INFORMATION, *PSAMPR_USER_INTERNAL1_INFORMATION; + +typedef struct _SAMPR_USER_INTERNAL4_INFORMATION +{ + SAMPR_USER_ALL_INFORMATION I1; + SAMPR_ENCRYPTED_USER_PASSWORD UserPassword; +} SAMPR_USER_INTERNAL4_INFORMATION, *PSAMPR_USER_INTERNAL4_INFORMATION; + +typedef struct _SAMPR_USER_INTERNAL4_INFORMATION_NEW +{ + SAMPR_USER_ALL_INFORMATION I1; + SAMPR_ENCRYPTED_USER_PASSWORD_NEW UserPassword; +} SAMPR_USER_INTERNAL4_INFORMATION_NEW, *PSAMPR_USER_INTERNAL4_INFORMATION_NEW; + +typedef struct _SAMPR_USER_INTERNAL5_INFORMATION +{ + SAMPR_ENCRYPTED_USER_PASSWORD UserPassword; + unsigned char PasswordExpired; +} SAMPR_USER_INTERNAL5_INFORMATION, *PSAMPR_USER_INTERNAL5_INFORMATION; + +typedef struct _SAMPR_USER_INTERNAL5_INFORMATION_NEW +{ + SAMPR_ENCRYPTED_USER_PASSWORD_NEW UserPassword; + unsigned char PasswordExpired; +} SAMPR_USER_INTERNAL5_INFORMATION_NEW, *PSAMPR_USER_INTERNAL5_INFORMATION_NEW; + +typedef enum _USER_INFORMATION_CLASS +{ + UserGeneralInformation = 1, + UserPreferencesInformation = 2, + UserLogonInformation = 3, + UserLogonHoursInformation = 4, + UserAccountInformation = 5, + UserNameInformation = 6, + UserAccountNameInformation = 7, + UserFullNameInformation = 8, + UserPrimaryGroupInformation = 9, + UserHomeInformation = 10, + UserScriptInformation = 11, + UserProfileInformation = 12, + UserAdminCommentInformation = 13, + UserWorkStationsInformation = 14, + UserControlInformation = 16, + UserExpiresInformation = 17, + UserInternal1Information = 18, + UserParametersInformation = 20, + UserAllInformation = 21, + UserInternal4Information = 23, + UserInternal5Information = 24, + UserInternal4InformationNew = 25, + UserInternal5InformationNew = 26, +} USER_INFORMATION_CLASS, *PUSER_INFORMATION_CLASS; + +typedef [switch_type(USER_INFORMATION_CLASS)] union _SAMPR_USER_INFO_BUFFER +{ + [case(UserGeneralInformation)] SAMPR_USER_GENERAL_INFORMATION General; + [case(UserPreferencesInformation)] SAMPR_USER_PREFERENCES_INFORMATION Preferences; + [case(UserLogonInformation)] SAMPR_USER_LOGON_INFORMATION Logon; + [case(UserLogonHoursInformation)] SAMPR_USER_LOGON_HOURS_INFORMATION LogonHours; + [case(UserAccountInformation)] SAMPR_USER_ACCOUNT_INFORMATION Account; + [case(UserNameInformation)] SAMPR_USER_NAME_INFORMATION Name; + [case(UserAccountNameInformation)] SAMPR_USER_A_NAME_INFORMATION AccountName; + [case(UserFullNameInformation)] SAMPR_USER_F_NAME_INFORMATION FullName; + [case(UserPrimaryGroupInformation)] USER_PRIMARY_GROUP_INFORMATION PrimaryGroup; + [case(UserHomeInformation)] SAMPR_USER_HOME_INFORMATION Home; + [case(UserScriptInformation)] SAMPR_USER_SCRIPT_INFORMATION Script; + [case(UserProfileInformation)] SAMPR_USER_PROFILE_INFORMATION Profile; + [case(UserAdminCommentInformation)] SAMPR_USER_ADMIN_COMMENT_INFORMATION AdminComment; + [case(UserWorkStationsInformation)] SAMPR_USER_WORKSTATIONS_INFORMATION WorkStations; + [case(UserControlInformation)] USER_CONTROL_INFORMATION Control; + [case(UserExpiresInformation)] USER_EXPIRES_INFORMATION Expires; + [case(UserInternal1Information)] SAMPR_USER_INTERNAL1_INFORMATION Internal1; + [case(UserParametersInformation)] SAMPR_USER_PARAMETERS_INFORMATION Parameters; + [case(UserAllInformation)] SAMPR_USER_ALL_INFORMATION All; + [case(UserInternal4Information)] SAMPR_USER_INTERNAL4_INFORMATION Internal4; + [case(UserInternal5Information)] SAMPR_USER_INTERNAL5_INFORMATION Internal5; + [case(UserInternal4InformationNew)] SAMPR_USER_INTERNAL4_INFORMATION_NEW Internal4New; + [case(UserInternal5InformationNew)] SAMPR_USER_INTERNAL5_INFORMATION_NEW Internal5New; +} SAMPR_USER_INFO_BUFFER, *PSAMPR_USER_INFO_BUFFER; + +typedef enum _PASSWORD_POLICY_VALIDATION_TYPE +{ + SamValidateAuthentication = 1, + SamValidatePasswordChange, + SamValidatePasswordReset +} PASSWORD_POLICY_VALIDATION_TYPE; + +typedef struct _SAM_VALIDATE_PASSWORD_HASH +{ + unsigned long Length; + [unique,size_is(Length)] unsigned char* Hash; +} SAM_VALIDATE_PASSWORD_HASH, *PSAM_VALIDATE_PASSWORD_HASH; + +typedef struct _SAM_VALIDATE_PERSISTED_FIELDS +{ + unsigned long PresentFields; + LARGE_INTEGER PasswordLastSet; + LARGE_INTEGER BadPasswordTime; + LARGE_INTEGER LockoutTime; + unsigned long BadPasswordCount; + unsigned long PasswordHistoryLength; + [unique,size_is(PasswordHistoryLength)] PSAM_VALIDATE_PASSWORD_HASH PasswordHistory; +} SAM_VALIDATE_PERSISTED_FIELDS, *PSAM_VALIDATE_PERSISTED_FIELDS; + +typedef enum _SAM_VALIDATE_VALIDATION_STATUS +{ + SamValidateSuccess = 0, + SamValidatePasswordMustChange, + SamValidateAccountLockedOut, + SamValidatePasswordExpired, + SamValidatePasswordIncorrect, + SamValidatePasswordIsInHistory, + SamValidatePasswordTooShort, + SamValidatePasswordTooLong, + SamValidatePasswordNotComplexEnough, + SamValidatePasswordTooRecent, + SamValidatePasswordFilterError +} SAM_VALIDATE_VALIDATION_STATUS, *PSAM_VALIDATE_VALIDATION_STATUS; + +typedef struct _SAM_VALIDATE_STANDARD_OUTPUT_ARG +{ + SAM_VALIDATE_PERSISTED_FIELDS ChangedPersistedFields; + SAM_VALIDATE_VALIDATION_STATUS ValidationStatus; +} SAM_VALIDATE_STANDARD_OUTPUT_ARG, *PSAM_VALIDATE_STANDARD_OUTPUT_ARG; + +typedef struct _SAM_VALIDATE_AUTHENTICATION_INPUT_ARG +{ + SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields; + unsigned char PasswordMatched; +} SAM_VALIDATE_AUTHENTICATION_INPUT_ARG, *PSAM_VALIDATE_AUTHENTICATION_INPUT_ARG; + +typedef struct _SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG +{ + SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields; + RPC_UNICODE_STRING ClearPassword; + RPC_UNICODE_STRING UserAccountName; + SAM_VALIDATE_PASSWORD_HASH HashedPassword; + unsigned char PasswordMatch; +} SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG; + +typedef struct _SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG +{ + SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields; + RPC_UNICODE_STRING ClearPassword; + RPC_UNICODE_STRING UserAccountName; + SAM_VALIDATE_PASSWORD_HASH HashedPassword; + unsigned char PasswordMustChangeAtNextLogon; + unsigned char ClearLockout; +} SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_RESET_INPUT_ARG; + +typedef [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] union _SAM_VALIDATE_INPUT_ARG +{ + [case(SamValidateAuthentication)] SAM_VALIDATE_AUTHENTICATION_INPUT_ARG ValidateAuthenticationInput; + [case(SamValidatePasswordChange)] SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG ValidatePasswordChangeInput; + [case(SamValidatePasswordReset)] SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG ValidatePasswordResetInput; +} SAM_VALIDATE_INPUT_ARG, *PSAM_VALIDATE_INPUT_ARG; + +typedef [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] union _SAM_VALIDATE_OUTPUT_ARG +{ + [case(SamValidateAuthentication)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidateAuthenticationOutput; + [case(SamValidatePasswordChange)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordChangeOutput; + [case(SamValidatePasswordReset)] SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordResetOutput; +} SAM_VALIDATE_OUTPUT_ARG, *PSAM_VALIDATE_OUTPUT_ARG; + +[ + uuid(12345778-1234-ABCD-EF00-0123456789AC), + version(1.0), + pointer_default(unique), + endpoint("ncacn_np:[\\pipe\\samr]") +#ifndef __midl + ,explicit_handle +#endif +] +interface samr +{ + /* Function 0 */ + NTSTATUS + __stdcall + SamrConnect( + [in, unique] PSAMPR_SERVER_NAME ServerName, + [out] SAMPR_HANDLE *ServerHandle, + [in] ACCESS_MASK DesiredAccess); + + /* Function 1 */ + NTSTATUS + __stdcall + SamrCloseHandle( + [in,out] SAMPR_HANDLE *SamHandle); + + /* Function 2 */ + NTSTATUS + __stdcall + SamrSetSecurityObject( + [in] SAMPR_HANDLE ObjectHandle, + [in] SECURITY_INFORMATION SecurityInformation, + [in] PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor); + + /* Function 3 */ + NTSTATUS + __stdcall + SamrQuerySecurityObject( + [in] SAMPR_HANDLE ObjectHandle, + [in] SECURITY_INFORMATION SecurityInformation, + [out] PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor); + + /* Function 4 */ + NTSTATUS + __stdcall + SamrShutdownSamServer( + [in] SAMPR_HANDLE ServerHandle); + + /* Function 5 */ + NTSTATUS + __stdcall + SamrLookupDomainInSamServer( + [in] SAMPR_HANDLE ServerHandle, + [in] PRPC_UNICODE_STRING Name, + [out] PRPC_SID *DomainId); + + /* Function 6 */ + NTSTATUS + __stdcall + SamrEnumerateDomainsInSamServer( + [in] SAMPR_HANDLE ServerHandle, + [in,out] unsigned long *EnumerationContext, + [out] PSAMPR_ENUMERATION_BUFFER *Buffer, + [in] unsigned long PreferedMaximumLength, + [out] unsigned long *CountReturned); + + /* Function 7 */ + NTSTATUS + __stdcall + SamrOpenDomain( + [in] SAMPR_HANDLE ServerHandle, + [in] ACCESS_MASK DesiredAccess, + [in] PRPC_SID DomainId, + [out] SAMPR_HANDLE *DomainHandle); + + /* Function 8 */ + NTSTATUS + __stdcall + SamrQueryInformationDomain( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_INFORMATION_CLASS DomainInformationClass, + [out, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER *Buffer); + + /* Function 9 */ + NTSTATUS + __stdcall + SamrSetInformationDomain( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_INFORMATION_CLASS DomainInformationClass, + [in, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER DomainInformation); + + /* Function 10 */ + NTSTATUS + __stdcall + SamrCreateGroupInDomain( + [in] SAMPR_HANDLE DomainHandle, + [in] PRPC_UNICODE_STRING Name, + [in] ACCESS_MASK DesiredAccess, + [out] SAMPR_HANDLE *GroupHandle, + [out] unsigned long *RelativeId); + + /* Function 11 */ + NTSTATUS + __stdcall + SamrEnumerateGroupsInDomain( + [in] SAMPR_HANDLE DomainHandle, + [in,out] unsigned long *EnumerationContext, + [out] PSAMPR_ENUMERATION_BUFFER *Buffer, + [in] unsigned long PreferedMaximumLength, + [out] unsigned long *CountReturned); + + /* Function 12 */ + NTSTATUS + __stdcall + SamrCreateUserInDomain([in] SAMPR_HANDLE DomainHandle, + [in] PRPC_UNICODE_STRING Name, + [in] ACCESS_MASK DesiredAccess, + [out] SAMPR_HANDLE *UserHandle, + [out] unsigned long *RelativeId); + + /* Function 13 */ + NTSTATUS + __stdcall + SamrEnumerateUsersInDomain([in] SAMPR_HANDLE DomainHandle, + [in,out] unsigned long *EnumerationContext, + [in] unsigned long UserAccountControl, + [out] PSAMPR_ENUMERATION_BUFFER *Buffer, + [in] unsigned long PreferedMaximumLength, + [out] unsigned long *CountReturned); + + /* Function 14 */ + NTSTATUS + __stdcall + SamrCreateAliasInDomain([in] SAMPR_HANDLE DomainHandle, + [in] PRPC_UNICODE_STRING AccountName, + [in] ACCESS_MASK DesiredAccess, + [out] SAMPR_HANDLE *AliasHandle, + [out] unsigned long *RelativeId); + + /* Function 15 */ + NTSTATUS + __stdcall + SamrEnumerateAliasesInDomain([in] SAMPR_HANDLE DomainHandle, + [in,out] unsigned long *EnumerationContext, + [out] PSAMPR_ENUMERATION_BUFFER *Buffer, + [in] unsigned long PreferedMaximumLength, + [out] unsigned long *CountReturned); + + /* Function 16 */ + NTSTATUS + __stdcall + SamrGetAliasMembership([in] SAMPR_HANDLE DomainHandle, + [in] PSAMPR_PSID_ARRAY SidArray, + [out] PSAMPR_ULONG_ARRAY Membership); + + /* Function 17 */ + NTSTATUS + __stdcall + SamrLookupNamesInDomain([in] SAMPR_HANDLE DomainHandle, + [in, range(0, 1000)] unsigned long Count, + [in, size_is(1000), length_is(Count)] RPC_UNICODE_STRING Names[*], + [out] PSAMPR_ULONG_ARRAY RelativeIds, + [out] PSAMPR_ULONG_ARRAY Use); + + /* Function 18 */ + NTSTATUS + __stdcall + SamrLookupIdsInDomain( + [in] SAMPR_HANDLE DomainHandle, + [in, range(0, 1000)] unsigned long Count, + [in, size_is(1000), length_is(Count)] unsigned long *RelativeIds, + [out] PSAMPR_RETURNED_USTRING_ARRAY Names, + [out] PSAMPR_ULONG_ARRAY Use); + + /* Function 19 */ + NTSTATUS + __stdcall + SamrOpenGroup( + [in] SAMPR_HANDLE DomainHandle, + [in] ACCESS_MASK DesiredAccess, + [in] unsigned long GroupId, + [out] SAMPR_HANDLE *GroupHandle); + + /* Function 20 */ + NTSTATUS + __stdcall + SamrQueryInformationGroup( + [in] SAMPR_HANDLE GroupHandle, + [in] GROUP_INFORMATION_CLASS GroupInformationClass, + [out, switch_is(GroupInformationClass)] PSAMPR_GROUP_INFO_BUFFER *Buffer); + + /* Function 21 */ + NTSTATUS + __stdcall + SamrSetInformationGroup( + [in] SAMPR_HANDLE GroupHandle, + [in] GROUP_INFORMATION_CLASS GroupInformationClass, + [in, switch_is(GroupInformationClass)] PSAMPR_GROUP_INFO_BUFFER Buffer); + + /* Function 22 */ + NTSTATUS + __stdcall + SamrAddMemberToGroup( + [in] SAMPR_HANDLE GroupHandle, + [in] unsigned long MemberId, + [in] unsigned long Attributes); + + /* Function 21 */ + NTSTATUS + __stdcall + SamrDeleteGroup( + [in,out] SAMPR_HANDLE *GroupHandle); + + /* Function 24 */ + NTSTATUS + __stdcall + SamrRemoveMemberFromGroup( + [in] SAMPR_HANDLE GroupHandle, + [in] unsigned long MemberId); + + /* Function 25 */ + NTSTATUS + __stdcall + SamrGetMembersInGroup( + [in] SAMPR_HANDLE GroupHandle, + [out] PSAMPR_GET_MEMBERS_BUFFER *Members); + + /* Function 26 */ + NTSTATUS + __stdcall + SamrSetMemberAttributesOfGroup( + [in] SAMPR_HANDLE GroupHandle, + [in] unsigned long MemberId, + [in] unsigned long Attributes); + + /* Function 27 */ + NTSTATUS + __stdcall + SamrOpenAlias( + [in] SAMPR_HANDLE DomainHandle, + [in] unsigned long DesiredAccess, + [in] unsigned long AliasId, + [out] SAMPR_HANDLE *AliasHandle); + + /* Function 28 */ + NTSTATUS + __stdcall + SamrQueryInformationAlias( + [in] SAMPR_HANDLE AliasHandle, + [in] ALIAS_INFORMATION_CLASS AliasInformationClass, + [out, switch_is(AliasInformationClass)] PSAMPR_ALIAS_INFO_BUFFER *Buffer); + + /* Function 29 */ + NTSTATUS + __stdcall + SamrSetInformationAlias( + [in] SAMPR_HANDLE AliasHandle, + [in] ALIAS_INFORMATION_CLASS AliasInformationClass, + [in, switch_is(AliasInformationClass)] PSAMPR_ALIAS_INFO_BUFFER Buffer); + + /* Function 30 */ + NTSTATUS + __stdcall + SamrDeleteAlias( + [in, out] SAMPR_HANDLE *AliasHandle); + + /* Function 31 */ + NTSTATUS + __stdcall + SamrAddMemberToAlias( + [in] SAMPR_HANDLE AliasHandle, + [in] PRPC_SID MemberId); + + /* Function 32 */ + NTSTATUS + __stdcall + SamrRemoveMemberFromAlias( + [in] SAMPR_HANDLE AliasHandle, + [in] PRPC_SID MemberId); + + /* Function 33 */ + NTSTATUS + __stdcall + SamrGetMembersInAlias( + [in] SAMPR_HANDLE AliasHandle, + [out] PSAMPR_PSID_ARRAY_OUT Members); + + /* Function 34 */ + NTSTATUS + __stdcall + SamrOpenUser( + [in] SAMPR_HANDLE DomainHandle, + [in] unsigned long DesiredAccess, + [in] unsigned long UserId, + [out] SAMPR_HANDLE *UserHandle); + + /* Function 35 */ + NTSTATUS + __stdcall + SamrDeleteUser( + [in,out] SAMPR_HANDLE *UserHandle); + + /* Function 36 */ + NTSTATUS + __stdcall + SamrQueryInformationUser( + [in] SAMPR_HANDLE UserHandle, + [in] USER_INFORMATION_CLASS UserInformationClass, + [out, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER *Buffer); + + /* Function 37 */ + NTSTATUS + __stdcall + SamrSetInformationUser( + [in] SAMPR_HANDLE UserHandle, + [in] USER_INFORMATION_CLASS UserInformationClass, + [in, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER Buffer); + + /* Function 38 */ + NTSTATUS + __stdcall + SamrChangePasswordUser( + [in] SAMPR_HANDLE UserHandle, + [in] unsigned char LmPresent, + [in, unique] PENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm, + [in, unique] PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm, + [in] unsigned char NtPresent, + [in, unique] PENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt, + [in, unique] PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt, + [in] unsigned char NtCrossEncryptionPresent, + [in, unique] PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithNewLm, + [in] unsigned char LmCrossEncryptionPresent, + [in, unique] PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt); + + /* Function 39 */ + NTSTATUS + __stdcall + SamrGetGroupsForUser( + [in] SAMPR_HANDLE UserHandle, + [out] PSAMPR_GET_GROUPS_BUFFER *Groups); + + /* Function 40 */ + NTSTATUS + __stdcall + SamrQueryDisplayInformation( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + [in] unsigned long Index, + [in] unsigned long EntryCount, + [in] unsigned long PreferredMaximumLength, + [out] unsigned long * TotalAvailable, + [out] unsigned long * TotalReturned, + [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer); + + /* Function 41 */ + NTSTATUS + __stdcall + SamrGetDisplayEnumerationIndex( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + [in] PRPC_UNICODE_STRING Prefix, + [out] unsigned long *Index); + + /* Function 42 */ + NTSTATUS + __stdcall + SamrTestPrivateFunctionsDomain( + [in] SAMPR_HANDLE DomainHandle); + + /* Function 43 */ + NTSTATUS + __stdcall + SamrTestPrivateFunctionsUser( + [in] SAMPR_HANDLE UserHandle); + + /* Function 44 */ + NTSTATUS + __stdcall + SamrGetUserDomainPasswordInformation( + [in] SAMPR_HANDLE UserHandle, + [out] PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation); + + /* Function 45 */ + NTSTATUS + __stdcall + SamrRemoveMemberFromForeignDomain( + [in] SAMPR_HANDLE DomainHandle, + [in] PRPC_SID MemberSid); + + /* Function 46 */ + NTSTATUS + __stdcall + SamrQueryInformationDomain2( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_INFORMATION_CLASS DomainInformationClass, + [out, switch_is(DomainInformationClass)] PSAMPR_DOMAIN_INFO_BUFFER *Buffer); + + /* Function 47 */ + NTSTATUS + __stdcall + SamrQueryInformationUser2( + [in] SAMPR_HANDLE UserHandle, + [in] USER_INFORMATION_CLASS UserInformationClass, + [out, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER *Buffer); + + /* Function 48 */ + NTSTATUS + __stdcall + SamrQueryDisplayInformation2( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + [in] unsigned long Index, + [in] unsigned long EntryCount, + [in] unsigned long PreferredMaximumLength, + [out] unsigned long *TotalAvailable, + [out] unsigned long *TotalReturned, + [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer); + + /* Function 49 */ + NTSTATUS + __stdcall + SamrGetDisplayEnumerationIndex2( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + [in] PRPC_UNICODE_STRING Prefix, + [out] unsigned long *Index); + + /* Function 50 */ + NTSTATUS + __stdcall + SamrCreateUser2InDomain( + [in] SAMPR_HANDLE DomainHandle, + [in] PRPC_UNICODE_STRING Name, + [in] unsigned long AccountType, + [in] unsigned long DesiredAccess, + [out] SAMPR_HANDLE *UserHandle, + [out] unsigned long *GrantedAccess, + [out] unsigned long *RelativeId); + + /* Function 51 */ + NTSTATUS + __stdcall + SamrQueryDisplayInformation3( + [in] SAMPR_HANDLE DomainHandle, + [in] DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, + [in] unsigned long Index, + [in] unsigned long EntryCount, + [in] unsigned long PreferredMaximumLength, + [out] unsigned long *TotalAvailable, + [out] unsigned long *TotalReturned, + [out, switch_is(DisplayInformationClass)] PSAMPR_DISPLAY_INFO_BUFFER Buffer); + + /* Function 52 */ + NTSTATUS + __stdcall + SamrAddMultipleMembersToAlias( + [in] SAMPR_HANDLE AliasHandle, + [in] PSAMPR_PSID_ARRAY MembersBuffer); + + /* Function 53 */ + NTSTATUS + __stdcall + SamrRemoveMultipleMembersFromAlias( + [in] SAMPR_HANDLE AliasHandle, + [in] PSAMPR_PSID_ARRAY MembersBuffer); + + /* Function 54 */ + NTSTATUS + __stdcall + SamrOemChangePasswordUser2( + [in] handle_t BindingHandle, + [in,unique] PRPC_STRING ServerName, + [in] PRPC_STRING UserName, + [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm, + [in,unique] PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewLm); + + /* Function 55 */ + NTSTATUS + __stdcall + SamrUnicodeChangePasswordUser2( + [in] handle_t BindingHandle, + [in,unique] PRPC_UNICODE_STRING ServerName, + [in] PRPC_UNICODE_STRING UserName, + [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldNt, + [in,unique] PENCRYPTED_NT_OWF_PASSWORD OldNtOwfPasswordEncryptedWithNewNt, + [in] unsigned char LmPresent, + [in,unique] PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm, + [in,unique] PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewNt); + + /* Function 56 */ + NTSTATUS + __stdcall + SamrGetDomainPasswordInformation( + [in] handle_t BindingHandle, + [in,unique] PRPC_UNICODE_STRING Unused, + [out] PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation); + + /* Function 57 */ + NTSTATUS + __stdcall + SamrConnect2( + [in,unique,string] PSAMPR_SERVER_NAME ServerName, + [out] SAMPR_HANDLE *ServerHandle, + [in] ACCESS_MASK DesiredAccess); + + /* Function 58 */ + NTSTATUS + __stdcall + SamrSetInformationUser2( + [in] SAMPR_HANDLE UserHandle, + [in] USER_INFORMATION_CLASS UserInformationClass, + [in, switch_is(UserInformationClass)] PSAMPR_USER_INFO_BUFFER Buffer); + + /* Function 59 */ + NTSTATUS + __stdcall + SamrSetBootKeyInformation( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 60 */ + NTSTATUS + __stdcall + SamrGetBootKeyInformation( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 61 */ + NTSTATUS + __stdcall + SamrConnect3( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 62 */ + NTSTATUS + __stdcall + SamrConnect4( + [in,unique,string] PSAMPR_SERVER_NAME ServerName, + [out] SAMPR_HANDLE *ServerHandle, + [in] unsigned long ClientRevision, + [in] ACCESS_MASK DesiredAccess); + + /* Function 63 */ + NTSTATUS + __stdcall + SamrUnicodeChangePasswordUser3( + [in] handle_t BindingHandle); /* FIXME */ + + /* Function 64 */ + NTSTATUS + __stdcall + SamrConnect5( + [in,unique,string] PSAMPR_SERVER_NAME ServerName, + [in] ACCESS_MASK DesiredAccess, + [in] unsigned long InVersion, + [in,switch_is(InVersion)] SAMPR_REVISION_INFO *InRevisionInfo, + [out] unsigned long *OutVersion, + [out,switch_is(*OutVersion)] SAMPR_REVISION_INFO *OutRevisionInfo, + [out] SAMPR_HANDLE *ServerHandle); + + /* Function 65 */ + NTSTATUS + __stdcall + SamrRidToSid( + [in] SAMPR_HANDLE ObjectHandle, + [in] unsigned long Rid, + [out] PRPC_SID *Sid); + + /* Function 66 */ + NTSTATUS + __stdcall + SamrSetDSRMPassword( + [in] handle_t BindingHandle, + [in,unique] PRPC_UNICODE_STRING Unused, + [in] unsigned long UserId, + [in,unique] PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword); + + /* Function 67 */ + NTSTATUS + __stdcall + SamrValidatePassword( + [in] handle_t Handle, + [in] PASSWORD_POLICY_VALIDATION_TYPE ValidationType, + [in,switch_is(ValidationType)] PSAM_VALIDATE_INPUT_ARG InputArg, + [out,switch_is(ValidationType)] PSAM_VALIDATE_OUTPUT_ARG *OutputArg); +} Propchange: trunk/reactos/include/reactos/idl/sam.idl ------------------------------------------------------------------------------ svn:eol-style = native
12 years, 7 months
1
0
0
0
[tfaber] 56643: [KERNEL32] - Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test. See issue #6786 for more details.
by tfaber@svn.reactos.org
Author: tfaber Date: Sun May 20 14:06:09 2012 New Revision: 56643 URL:
http://svn.reactos.org/svn/reactos?rev=56643&view=rev
Log: [KERNEL32] - Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test. See issue #6786 for more details. Modified: trunk/reactos/dll/win32/kernel32/client/path.c trunk/reactos/dll/win32/kernel32/client/proc.c Modified: trunk/reactos/dll/win32/kernel32/client/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] Sun May 20 14:06:09 2012 @@ -307,7 +307,7 @@ } break; - /* Add the current applicaiton path */ + /* Add the current application path */ case BaseSearchPathApp: if ((AppName) && (AppNameEnd)) { Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sun May 20 14:06:09 2012 @@ -778,6 +778,21 @@ if ((Size) && (Size <= (MAX_PATH + 4))) { /* Get the DLL Path */ + DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment); + if (!DllPathString) + { + /* Fail */ + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Initialize Strings */ + RtlInitUnicodeString(&DllPath, DllPathString); + RtlInitUnicodeString(&ImageName, FullPath); + } + else + { + /* Couldn't get the path name. Just take the original path */ DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName, lpEnvironment); if (!DllPathString) @@ -790,21 +805,6 @@ /* Initialize Strings */ RtlInitUnicodeString(&DllPath, DllPathString); RtlInitUnicodeString(&ImageName, ApplicationPathName); - } - else - { - /* Get the DLL Path */ - DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment); - if (!DllPathString) - { - /* Fail */ - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - /* Initialize Strings */ - RtlInitUnicodeString(&DllPath, DllPathString); - RtlInitUnicodeString(&ImageName, FullPath); } /* Initialize Strings */ @@ -1656,7 +1656,7 @@ /* Someone beat us to it, use their data instead */ StartupInfo = BaseAnsiStartupInfo; Status = STATUS_SUCCESS; - + /* We're going to free our own stuff, but not raise */ RtlFreeAnsiString(&TitleString); }
12 years, 7 months
1
0
0
0
[jimtabor] 56642: [UXTHEME] - Partial sync port Wine 1.5.4 for system.c. - Researched branches/GSoC_2011/ThemesSupport and current changes before sync.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun May 20 05:11:54 2012 New Revision: 56642 URL:
http://svn.reactos.org/svn/reactos?rev=56642&view=rev
Log: [UXTHEME] - Partial sync port Wine 1.5.4 for system.c. - Researched branches/GSoC_2011/ThemesSupport and current changes before sync. Modified: trunk/reactos/dll/win32/uxtheme/system.c trunk/reactos/dll/win32/uxtheme/uxtheme.spec trunk/reactos/include/psdk/uxtheme.h Modified: trunk/reactos/dll/win32/uxtheme/system.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
============================================================================== --- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Sun May 20 05:11:54 2012 @@ -620,9 +620,9 @@ } /*********************************************************************** - * OpenThemeData (UXTHEME.@) - */ -HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList) + * OpenThemeDataEx (UXTHEME.61) + */ +HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags) { WCHAR szAppBuff[256]; WCHAR szClassBuff[256]; @@ -631,8 +631,14 @@ HTHEME hTheme = NULL; TRACE("(%p,%s)\n", hwnd, debugstr_w(pszClassList)); - if(pszClassList == NULL) - SetLastError(E_POINTER); + if(!pszClassList) + { + SetLastError(E_POINTER); + return NULL; + } + + if(flags) + FIXME("unhandled flags: %x\n", flags); if(bThemeActive) { @@ -648,8 +654,15 @@ if(IsWindow(hwnd)) SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme); TRACE(" = %p\n", hTheme); - return hTheme; +} + +/*********************************************************************** + * OpenThemeData (UXTHEME.@) + */ +HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist) +{ + return OpenThemeDataEx(hwnd, classlist, 0); } /*********************************************************************** Modified: trunk/reactos/dll/win32/uxtheme/uxtheme.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/uxtheme.…
============================================================================== --- trunk/reactos/dll/win32/uxtheme/uxtheme.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/uxtheme.spec [iso-8859-1] Sun May 20 05:11:54 2012 @@ -38,7 +38,7 @@ 46 stub -noname ClassicAdjustWindowRectEx 48 stub -noname GetThemeParseErrorInfo 60 stub -noname CreateThemeDataFromObjects -61 stub -noname OpenThemeDataEx +61 stdcall OpenThemeDataEx(ptr wstr long) 62 stub -noname ServerClearStockObjects 63 stub -noname MarkSelection Modified: trunk/reactos/include/psdk/uxtheme.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/uxtheme.h?rev…
============================================================================== --- trunk/reactos/include/psdk/uxtheme.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/uxtheme.h [iso-8859-1] Sun May 20 05:11:54 2012 @@ -136,6 +136,7 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND); BOOL WINAPI IsThemePartDefined(HTHEME,int,int); HTHEME WINAPI OpenThemeData(HWND,LPCWSTR); +HTHEME WINAPI OpenThemeDataEx(HWND,LPCWSTR,DWORD); void WINAPI SetThemeAppProperties(DWORD); HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR); #endif
12 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200