25 TRACE(
"SampInitDatabase()\n");
28 L"\\Registry\\Machine\\SAM",
33 ERR(
"Failed to open the SAM key (Status: 0x%08lx)\n",
Status);
37 TRACE(
"SampInitDatabase() done\n");
64 if (ParentObject ==
NULL)
67 ParentKeyHandle = ParentObject->KeyHandle;
69 if (ContainerName !=
NULL)
142 NewObject->MembersKeyHandle = MembersKeyHandle;
146 if (ParentObject !=
NULL)
147 NewObject->Trusted = ParentObject->Trusted;
188 if (DbObject ==
NULL)
193 if (ParentObject ==
NULL)
196 ParentKeyHandle = ParentObject->KeyHandle;
198 if (ContainerName !=
NULL)
204 &ContainerKeyHandle);
270 NewObject->MembersKeyHandle = MembersKeyHandle;
274 if (ParentObject !=
NULL)
275 NewObject->Trusted = ParentObject->Trusted;
332 ERR(
"SampValidateDbObject access check failed %08lx %08lx\n",
338 if (DbObject !=
NULL)
339 *DbObject = LocalObject;
377 TRACE(
"(%p)\n", DbObject);
383 ContainerName =
L"Aliases";
387 ContainerName =
L"Groups";
391 ContainerName =
L"Users";
406 TRACE(
"SampGetObjectAttribute failed (Status 0x%08lx)\n",
Status);
413 if (AccountName ==
NULL)
426 TRACE(
"SampGetObjectAttribute failed (Status 0x%08lx)\n",
Status);
447 TRACE(
"SampRegOpenKey failed (Status 0x%08lx)\n",
Status);
458 TRACE(
"SampRegOpenKey failed (Status 0x%08lx)\n",
Status);
467 TRACE(
"SampRegDeleteValue failed (Status 0x%08lx)\n",
Status);
476 TRACE(
"SampRegDeleteKey failed (Status 0x%08lx)\n",
Status);
493 if (AccountName !=
NULL)
552 String->MaximumLength = 0;
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define STATUS_INVALID_HANDLE
#define NT_SUCCESS(StatCode)
NTSTATUS SampGetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PULONG AttributeType, LPVOID AttributeData, PULONG AttributeSize)
NTSTATUS SampSetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, ULONG AttributeType, LPVOID AttributeData, ULONG AttributeSize)
NTSTATUS SampCloseDbObject(PSAM_DB_OBJECT DbObject)
NTSTATUS SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject, IN LPWSTR ContainerName, IN LPWSTR ObjectName, IN ULONG RelativeId, IN SAM_DB_OBJECT_TYPE ObjectType, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *DbObject)
NTSTATUS SampDeleteAccountDbObject(PSAM_DB_OBJECT DbObject)
NTSTATUS SampValidateDbObject(SAMPR_HANDLE Handle, SAM_DB_OBJECT_TYPE ObjectType, ACCESS_MASK DesiredAccess, PSAM_DB_OBJECT *DbObject)
NTSTATUS SampCreateDbObject(IN PSAM_DB_OBJECT ParentObject, IN LPWSTR ContainerName, IN LPWSTR ObjectName, IN ULONG RelativeId, IN SAM_DB_OBJECT_TYPE ObjectType, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *DbObject)
NTSTATUS SampSetObjectAttributeString(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PRPC_UNICODE_STRING String)
NTSTATUS SampInitDatabase(VOID)
NTSTATUS SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PRPC_UNICODE_STRING String)
static HANDLE SamKeyHandle
NTSTATUS SampRegQueryValue(IN HANDLE KeyHandle, IN LPCWSTR ValueName, OUT PULONG Type OPTIONAL, OUT PVOID Data OPTIONAL, IN OUT PULONG DataLength OPTIONAL)
NTSTATUS SampRegCloseKey(IN OUT PHANDLE KeyHandle)
NTSTATUS SampRegSetValue(HANDLE KeyHandle, LPCWSTR ValueName, ULONG Type, LPVOID Data, ULONG DataLength)
NTSTATUS SampRegDeleteKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName)
NTSTATUS SampRegOpenKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle)
NTSTATUS SampRegDeleteValue(IN HANDLE KeyHandle, IN LPCWSTR ValueName)
NTSTATUS SampRegCreateKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle)
#define SAMP_DB_SIGNATURE
enum _SAM_DB_OBJECT_TYPE SAM_DB_OBJECT_TYPE
struct _SAM_DB_OBJECT * PSAM_DB_OBJECT
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define EXCEPTION_EXECUTE_HANDLER
#define KEY_CREATE_SUB_KEY
#define KEY_ENUMERATE_SUB_KEYS
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define _SEH2_EXCEPT(...)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define midl_user_allocate
#define STATUS_BUFFER_OVERFLOW
SAM_DB_OBJECT_TYPE ObjectType
struct _SAM_DB_OBJECT * ParentObject
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
_Inout_opt_ PACCESS_STATE _In_opt_ ACCESS_MASK _In_ ULONG _Out_opt_ PVOID * NewObject