16static const unsigned char rawDB[] =
19 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x73, 0x64, 0x62, 0x66,
22 0x01, 0x70, 0x22, 0x00, 0x00, 0x00,
24 0x01, 0x60, 0x06, 0x00, 0x00, 0x00,
27 0x07, 0x90, 0x10, 0x00, 0x00, 0x00,
29 0xEB, 0x75, 0xDD, 0x79, 0x98, 0xC0, 0x57, 0x47, 0x99, 0x65, 0x9E, 0x83, 0xC4, 0xCA, 0x9D, 0xA4,
32 0x02, 0x70, 0x00, 0x00, 0x00, 0x00,
35 0x01, 0x78, 0x0E, 0x00, 0x00, 0x00,
37 0x01, 0x88, 0x08, 0x00, 0x00, 0x00,
38 0x49, 0x00, 0x43, 0x00, 0x53, 0x00, 0x00, 0x00
54 ok(dwWritten ==
Size,
"WriteFile wrote %u bytes instead of %u\n", dwWritten,
Size);
60 ok(dwGuidSize ==
sizeof(
GUID),
"WriteFile wrote %u bytes instead of %u\n", dwGuidSize,
sizeof(
GUID));
68static const GUID GUID_DATABASE_SHIM = { 0x11111111, 0x1111, 0x1111, { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 } };
69static const GUID GUID_DATABASE_MSI = { 0xd8ff6d16, 0x6a3a, 0x468a, { 0x8b, 0x44, 0x01, 0x71, 0x4d, 0xdc, 0x49, 0xea } };
70static const GUID GUID_DATABASE_DRIVERS = { 0xf9ab2228, 0x3312, 0x4a73, { 0xb6, 0xf9, 0x93, 0x6d, 0x70, 0xe1, 0x12, 0xef } };
71static const GUID TEST_DB_GUID = { 0x79dd75eb, 0xc098, 0x4757, { 0x99, 0x65, 0x9e, 0x83, 0xc4, 0xca, 0x9d, 0xa4 } };
73#define SDB_DATABASE_MAIN 0x80000000
85 PSID AdministratorsGroup;
91 &AdministratorsGroup);
138 ok(0,
"Unable to format guid\n");
160 Status =
key.QueryDWORDValue(
L"DatabaseType", ValueBuffer);
163 winetest_ok(ValueBuffer ==
Type,
"Expected DatabaseType to be 0x%x, was 0x%x\n",
Type, ValueBuffer);
179 winetest_ok(DiffMS < 5000 ,
"Expected DatabaseInstallTimeStamp to be less than 5 seconds before now (was: %u)\n", DiffMS);
185#define ok_keys (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : ok_keys_
202 *(
void**)&pSdbRegisterDatabaseEx = (
void*)
GetProcAddress(
hdll,
"SdbRegisterDatabaseEx");
203 *(
void**)&pSdbUnregisterDatabase = (
void*)
GetProcAddress(
hdll,
"SdbUnregisterDatabase");
205 if (!pSdbRegisterDatabase || !pSdbRegisterDatabaseEx || !pSdbUnregisterDatabase)
207 skip(
"Not all functions present: %p, %p, %p\n", pSdbRegisterDatabase, pSdbRegisterDatabaseEx, pSdbUnregisterDatabase);
219 skip(
"Not running as admin, unable to install databases!\n");
232 Success = pSdbRegisterDatabase(TempPath, 0);
242 Success = pSdbRegisterDatabase(TempPath, 1);
262 Success = pSdbRegisterDatabaseEx(TempPath, 0,
NULL);
272 Success = pSdbRegisterDatabaseEx(TempPath, 1,
NULL);
333 Success = pSdbRegisterDatabase(TempPath, 0);
349 Success = pSdbRegisterDatabase(TempPath, 0);
365 Success = pSdbRegisterDatabase(TempPath, 0);
PRTL_UNICODE_STRING_BUFFER Path
#define ok_int(expression, result)
static SID_IDENTIFIER_AUTHORITY NtAuthority
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NT_SUCCESS(StatCode)
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
PVOID WINAPI FreeSid(PSID pSid)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
@ ProcessWow64Information
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
static PLARGE_INTEGER Time
#define NtCurrentProcess()
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
static DWORD QueryFlag(void)
DWORD const PULONGLONG pTimeStamp
static void FileTimeNow(ULARGE_INTEGER &Result)
static const GUID TEST_DB_GUID
static const GUID GUID_DATABASE_DRIVERS
#define SDB_DATABASE_MAIN
static void ok_keys_(REFGUID Guid, LPCWSTR DisplayName, LPCWSTR Path, DWORD Type, PULONGLONG TimeStamp)
static const GUID GUID_DATABASE_MSI
static const unsigned char rawDB[]
static BOOL WriteSdbFile(const WCHAR *FileName, const unsigned char *Data, DWORD Size, const GUID *CustomID)
static const GUID GUID_DATABASE_SHIM
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_NT_AUTHORITY
#define DOMAIN_ALIAS_RID_ADMINS