All pastes #346260 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-09 06:01 UTC
rendered paste body
// Single parameter __stdcall thunk
template < typename T1 >
DWORD Thunk_stdcall(void* pFunc, T1 arg1)
{
	DWORD dwRC;					// Return value

	__asm
	{
		push	arg1;			// Push argument 1
		call	pFunc;			// Call function
		mov		dwRC,  eax;		// Get return result
	}

	return dwRC;
}