9 #define WIN32_NO_STATUS 16 static 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));
68 static const GUID GUID_DATABASE_SHIM = { 0x11111111, 0x1111, 0x1111, { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 } };
69 static const GUID GUID_DATABASE_MSI = { 0xd8ff6d16, 0x6a3a, 0x468a, { 0x8b, 0x44, 0x01, 0x71, 0x4d, 0xdc, 0x49, 0xea } };
70 static const GUID GUID_DATABASE_DRIVERS = { 0xf9ab2228, 0x3312, 0x4a73, { 0xb6, 0xf9, 0x93, 0x6d, 0x70, 0xe1, 0x12, 0xef } };
71 static const GUID TEST_DB_GUID = { 0x79dd75eb, 0xc098, 0x4757, { 0x99, 0x65, 0x9e, 0x83, 0xc4, 0xca, 0x9d, 0xa4 } };
73 #define SDB_DATABASE_MAIN 0x80000000 84 PSID AdministratorsGroup;
90 &AdministratorsGroup);
137 ok(0,
"Unable to format guid\n");
159 Status =
key.QueryDWORDValue(
L"DatabaseType", ValueBuffer);
162 winetest_ok(ValueBuffer ==
Type,
"Expected DatabaseType to be 0x%x, was 0x%x\n",
Type, ValueBuffer);
178 winetest_ok(DiffMS < 5000 ,
"Expected DatabaseInstallTimeStamp to be less than 5 seconds before now (was: %u)\n", DiffMS);
184 #define ok_keys (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : ok_keys_ 201 *(
void**)&pSdbRegisterDatabaseEx = (
void*)
GetProcAddress(
hdll,
"SdbRegisterDatabaseEx");
202 *(
void**)&pSdbUnregisterDatabase = (
void*)
GetProcAddress(
hdll,
"SdbUnregisterDatabase");
204 if (!pSdbRegisterDatabase || !pSdbRegisterDatabaseEx || !pSdbUnregisterDatabase)
206 skip(
"Not all functions present: %p, %p, %p\n", pSdbRegisterDatabase, pSdbRegisterDatabaseEx, pSdbUnregisterDatabase);
218 skip(
"Not running as admin, unable to install databases!\n");
231 Success = pSdbRegisterDatabase(TempPath, 0);
241 Success = pSdbRegisterDatabase(TempPath, 1);
261 Success = pSdbRegisterDatabaseEx(TempPath, 0,
NULL);
271 Success = pSdbRegisterDatabaseEx(TempPath, 1,
NULL);
332 Success = pSdbRegisterDatabase(TempPath, 0);
348 Success = pSdbRegisterDatabase(TempPath, 0);
364 Success = pSdbRegisterDatabase(TempPath, 0);
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
static const GUID GUID_DATABASE_SHIM
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
static void ok_keys_(REFGUID Guid, LPCWSTR DisplayName, LPCWSTR Path, DWORD Type, PULONGLONG TimeStamp)
char * wine_dbgstr_w(const wchar_t *wstr)
BOOL(WINAPI *pSdbRegisterDatabase)(LPCWSTR pszDatabasePath
NTSTATUS NTAPI NtQueryInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength OPTIONAL)
#define INVALID_HANDLE_VALUE
IN PVOID IN PVOID IN USHORT IN USHORT Size
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
static void FileTimeNow(ULARGE_INTEGER &Result)
DWORD const PULONGLONG pTimeStamp
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
PVOID WINAPI FreeSid(PSID pSid)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
#define ok_int(expression, result)
_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_NT_AUTHORITY
#define NtCurrentProcess()
static const GUID GUID_DATABASE_DRIVERS
#define SECURITY_BUILTIN_DOMAIN_RID
#define NT_SUCCESS(StatCode)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
static const unsigned char rawDB[]
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
static const GUID TEST_DB_GUID
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
static DWORD QueryFlag(void)
#define FILE_ATTRIBUTE_NORMAL
static const GUID GUID_DATABASE_MSI
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
PRTL_UNICODE_STRING_BUFFER Path
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
#define SDB_DATABASE_MAIN
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define GetProcAddress(x, y)
#define DOMAIN_ALIAS_RID_ADMINS
static PLARGE_INTEGER Time
SID_IDENTIFIER_AUTHORITY NtAuthority
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)
#define HKEY_LOCAL_MACHINE
static BOOL WriteSdbFile(const WCHAR *FileName, const unsigned char *Data, DWORD Size, const GUID *CustomID)