73 else if (dwWritten !=
dwSize)
75 trace(
"Extract resource failed, written size (%lu) is not actual size (%lu)\n", dwWritten,
dwSize);
132 HMODULE hNtDll, hTestDll, hNotifiedDllBase;
136 PVOID Cookie1, Cookie2;
147 if (!pfnLdrRegisterDllNotification || !pfnLdrUnregisterDllNotification)
149 skip(
"ntdll.dll!Ldr[Un]RegisterDllNotification not found\n");
179 hNotifiedDllBase =
NULL;
184 ok(Cookie1 !=
NULL,
"Cookie1 is NULL\n");
189 ok(Cookie2 !=
NULL,
"Cookie2 is NULL\n");
215 Status = pfnLdrUnregisterDllNotification(Cookie1);
230 Status = pfnLdrUnregisterDllNotification(Cookie2);
static volatile LONG g_lDllLoadCount
static WCHAR g_szDllPath[MAX_PATH]
static UNICODE_STRING g_usDllPath
static UNICODE_STRING g_usDllName
static BOOL ExtractResource(_In_z_ PCWSTR SavePath, _In_ PCWSTR ResourceType, _In_ PCWSTR ResourceName)
NTSTATUS NTAPI FN_LdrUnregisterDllNotification(_In_ PVOID Cookie)
static VOID NTAPI DllLoadCallback(_In_ ULONG NotificationReason, _In_ PCLDR_DLL_NOTIFICATION_DATA NotificationData, _In_opt_ PVOID Context)
NTSTATUS NTAPI FN_LdrRegisterDllNotification(_In_ ULONG Flags, _In_ PLDR_DLL_NOTIFICATION_FUNCTION NotificationFunction, _In_opt_ PVOID Context, _Out_ PVOID *Cookie)
#define ok_eq_pointer(value, expected)
#define ok_eq_ulong(value, expected)
#define ok_eq_long(value, expected)
#define ok_eq_bool(value, expected)
#define InterlockedIncrement
#define InterlockedDecrement
#define NT_SUCCESS(StatCode)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
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)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
#define LDR_DLL_NOTIFICATION_REASON_UNLOADED
#define LDR_DLL_NOTIFICATION_REASON_LOADED
VOID(NTAPI * PLDR_DLL_NOTIFICATION_FUNCTION)(_In_ ULONG NotificationReason, _In_ PCLDR_DLL_NOTIFICATION_DATA NotificationData, _In_opt_ PVOID Context)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static char szTempPath[MAX_PATH]
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
_In_ PCWDF_DEVICE_PNP_NOTIFICATION_DATA NotificationData
DWORD WINAPI GetLastError(void)
#define ERROR_INCORRECT_SIZE
#define MAKEINTRESOURCEW(i)
_Must_inspect_result_ _In_ ULONG Flags
_In_opt_ PVOID _Out_ PLARGE_INTEGER Cookie