27#ifndef FACILITY_VISUALCPP
28#define FACILITY_VISUALCPP ((LONG)0x6d)
32#define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err)
36#define WINMM_DLLNAME "winmm.dll"
38#define WINMM_DLLNAME "WINMM.dll"
106 "Expected code %u to be processed by the Hook, not the ErrorHandler for %s\n", dliNotify,
target(pdli));
112 "Expected code %u to be processed by the ErrorHandler, not the Hook for %s\n", dliNotify,
target(pdli));
122 "Expected g_DliHookExpected[g_DliHookIndex] to be %u, was: %u for %s\n",
128#define CheckDli (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : CheckDli_imp
129#define CheckDliDone (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : CheckDliDone_imp
147 ok(pdli && pdli->
cb >= 36,
"Expected a valid pointer with a struct that is big enough: %p, %lu\n",
148 pdli, pdli ? pdli->
cb : 0
u);
149 if (!pdli || pdli->
cb < 36)
return NULL;
159 char c = procname[0];
183 dll[0] =
'l';
dll[1] =
'_';
dll[2] =
'm';
214 ok(pdli->
ppfn !=
NULL,
"Expected ppfn to be valid, was NULL for %s\n",
target(pdli));
215 ok(pdli->
szDll !=
NULL,
"Expected szDll to be valid, was NULL for %s\n",
target(pdli));
217 "Expected dwLastError to be ERROR_SUCCESS, was: %lu for %s\n", pdli->
dwLastError,
target(pdli));
222 ok(pdli->
dlp.
dwOrdinal != 0,
"Expected dwOrdinal to be valid, was NULL for %s\n",
target(pdli));
234 ok(pdli->
hmodCur !=
NULL,
"Expected hmodCur to be valid, was NULL for %s\n",
target(pdli));
239 ok(pdli->
hmodCur !=
NULL,
"Expected hmodCur to be valid, was NULL for %s\n",
target(pdli));
240 ok(pdli->
pfnCur !=
NULL,
"Expected pfnCur to be a valid pointer, was NULL for %s\n",
target(pdli));
244 ok(targetProc !=
NULL,
"This should not happen, the function i need is unavail! (%s!%s)\n",
246 ok(targetProc == pdli->
pfnCur,
"Expected pfnCur to be %p, was %p for %s\n", targetProc, pdli->
pfnCur,
target(pdli));
248 "Expected ppfn to be valid and to result in %p, was: %p(%p) for %s\n",
260 ok(pdli && pdli->
cb >= 36,
261 "Expected a valid pointer with a struct that is big enough: %p, %lu\n", pdli, pdli ? pdli->
cb : 0
u);
262 if (!pdli || pdli->
cb < 36)
return NULL;
281 ok(pdli->
ppfn !=
NULL,
"Expected ppfn to be valid, was NULL for %s\n",
target(pdli));
282 ok(pdli->
szDll !=
NULL,
"Expected szDll to be valid, was NULL for %s\n",
target(pdli));
286 ok(pdli->
dlp.
dwOrdinal != 0,
"Expected dwOrdinal to be valid, was NULL for %s\n",
target(pdli));
293 "Expected dwLastError to be ERROR_MOD_NOT_FOUND, was: %lu for %s\n", pdli->
dwLastError,
target(pdli));
296 ok(pdli->
hmodCur !=
NULL,
"Expected hmodCur to be valid, was NULL for %s\n",
target(pdli));
299 "Expected dwLastError to be ERROR_PROC_NOT_FOUND, was: %lu for %s\n", pdli->
dwLastError,
target(pdli));
311 ok(ExceptionInfo !=
NULL,
"Expected to get exception info\n");
312 ok(ExceptionInfo->ExceptionRecord !=
NULL,
"Expected to get a valid record info\n");
316 skip(
"Skipping other checks, this was not the exception we expected!\n");
320 if (ExceptionInfo && ExceptionInfo->ExceptionRecord)
326 ok(ExceptionRecord->
ExceptionFlags == 0,
"Expected ExceptionFlags to be 0, was: 0x%lx\n",
333 ok(LoadInfo && LoadInfo->
cb >= 36,
"Expected a valid pointer with a struct that is big enough: %p, %lu\n",
334 LoadInfo, LoadInfo ? LoadInfo->
cb : 0);
379template<
typename PTR>
384 return reinterpret_cast<PTR>(rva);
385 return reinterpret_cast<PTR>((
reinterpret_cast<PBYTE>(
dos) + rva));
424 if (delaydir->
Size != 0)
426#if defined(_DELAY_IMP_VER) && _DELAY_IMP_VER == 2 && defined(DELAYLOAD_SUPPORTS_UNLOADING)
429 ok(
mod ==
NULL,
"Expected mod to be NULL, was %p\n",
mod);
431 HRESULT hr = __HrLoadAllImportsForDll(
"WiNmM.DlL");
434 ok(
mod ==
NULL,
"Expected mod to be NULL, was %p\n",
mod);
438 ok(
hr ==
S_OK,
"Expected hr to be S_OK, was %lu\n",
hr);
440 ok(
mod !=
NULL,
"Expected mod to be valid, was NULL\n");
443 ok(
status ==
TRUE,
"Expected __FUnloadDelayLoadedDLL2 to succeed\n");
445 ok(
mod ==
NULL,
"Expected mod to be NULL, was %p\n",
mod);
447 trace(
"Binary compiled without support for unloading\n");
452 skip(
"No IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT found, some advanced features might not work!\n");
493 ok(
ret == 12345,
"Expected ret to be 12345, was %u\n",
ret);
516 skip(
"SymGetOptions until CORE-6504 is fixed\n");
525 ok(opt == 123,
"Expected opt to be 123, was %lu\n", opt);
541 skip(
"MapAndLoad until CORE-6504 is fixed\n");
std::map< E_MODULE, HMODULE > mod
int strcmp(const char *String1, const char *String2)
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
#define VcppException(sev, err)
unsigned g_winmm_midi_out_close[]
static void CheckDli_imp(unsigned dliNotify, PDelayLoadInfo pdli, BOOL ErrorHandler)
static void SetExpectedDli(unsigned *order)
PfnDliHook __pfnDliNotifyHook2
unsigned * g_DliHookExpected
static void CheckDliDone_imp()
unsigned g_winmm_get_cur_task[]
unsigned g_winmm_mide_in_close[]
const char * g_ExpectedName
LONG ExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo, ULONG ExceptionCode)
FARPROC WINAPI DliFailHook(unsigned dliNotify, PDelayLoadInfo pdli)
const char * g_ExpectedDll
static HMODULE g_VersionDll
INT_PTR WINAPI MyFunction()
bool g_BrokenFunctionName
BOOL WINAPI MySfcIsKeyProtected(HKEY KeyHandle, LPCWSTR SubKeyName, REGSAM KeySam)
FARPROC WINAPI DliHook(unsigned dliNotify, PDelayLoadInfo pdli)
PTR Rva2Addr(PIMAGE_DOS_HEADER dos, RVA rva)
struct DelayLoadInfo * PDelayLoadInfo
@ dliNotePreGetProcAddress
FARPROC(WINAPI * PfnDliHook)(unsigned, PDelayLoadInfo)
#define ERROR_MOD_NOT_FOUND
#define GetProcAddress(x, y)
DWORD WINAPI SymGetOptions(void)
BOOL WINAPI MapAndLoad(PCSTR pszImageName, PCSTR pszDllPath, PLOADED_IMAGE pLoadedImage, BOOL bDotDll, BOOL bReadOnly)
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y)
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
BOOL WINAPI GetFileVersionInfoA(LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data)
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
GLuint GLdouble GLdouble GLint GLint order
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_EXECUTION
#define URL_E_INVALID_SYNTAX
#define MMSYSERR_INVALHANDLE
#define sprintf(buf, format,...)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING SubKeyName
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
#define PAGE_EXECUTE_READWRITE
#define ERROR_SEVERITY_ERROR
#define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT
PfnDliHook __pfnDliFailureHook2
#define IMAGE_DOS_SIGNATURE
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
DWORD WINAPI mmGetCurrentTask(void)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
BOOL WINAPI SfcGetNextProtectedFile(HANDLE RpcHandle, PPROTECTED_FILE_DATA ProtFileData)
BOOL WINAPI SfcIsKeyProtected(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired)
struct _EXCEPTION_RECORD * ExceptionRecord
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
DWORD WINAPI GetCurrentThreadId(void)
#define HRESULT_FROM_WIN32(x)
#define ERROR_PROC_NOT_FOUND
UINT WINAPI mixerClose(HMIXER hMix)
UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)