diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 22262bf06..a9fab1b2a 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -73,6 +73,19 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) return TRUE; } +NTSTATUS steamclient_call( unsigned int code, void *args, const char *name ) +{ + NTSTATUS status = WINE_UNIX_CALL( code, args ); + + if (status == STATUS_ACCESS_VIOLATION) + { + ERR( "Access violation in %s.\n", name ); + RaiseException( status, 0, 0, NULL ); + } + if (status) WARN( "%s failed, status %#x\n", name, (UINT)status ); + return status; +} + static BYTE *alloc_start, *alloc_end; static int8_t allocated_from_steamclient_dll( void *ptr ) diff --git a/lsteamclient/unixlib.h b/lsteamclient/unixlib.h index 991e2b012..c5f6eea62 100644 --- a/lsteamclient/unixlib.h +++ b/lsteamclient/unixlib.h @@ -216,10 +216,11 @@ struct networking_message #include +NTSTATUS steamclient_call( unsigned int code, void *args, const char *name ); + #define STEAMCLIENT_CALL( code, args ) \ ({ \ - NTSTATUS status = WINE_UNIX_CALL( unix_ ## code, args ); \ - if (status) WARN( #code " failed, status %#x\n", (UINT)status ); \ + NTSTATUS status = steamclient_call( unix_ ## code, args, #code ); \ assert( !status ); \ status; \ })