lsteamclient: Propagate Unix side access violation to the PE side exception.

CW-Bug-Id: #23623
This commit is contained in:
Paul Gofman 2024-03-27 14:00:11 -06:00
parent 3cba1580fe
commit a287ebaaf9
2 changed files with 16 additions and 2 deletions

View File

@ -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 )

View File

@ -216,10 +216,11 @@ struct networking_message
#include <poppack.h>
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; \
})