mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.1 KiB
67 lines
1.1 KiB
/*++
|
|
|
|
Copyright (c) 2000 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
ChemOffice.cpp
|
|
|
|
Abstract:
|
|
|
|
This shim fixes a problem where a dialog box comes up after
|
|
selecting Gaussian Run. The dialog box warns of a windows
|
|
error that only occurs because we are shim'ing the app with
|
|
EmulateHeap. We are unable to remove EmulateHeap since this
|
|
causes the app to AV so the only solution at this time is to
|
|
ignore the invalid paramater windows error message that occurs.
|
|
|
|
Notes:
|
|
|
|
This is a specific shim.
|
|
|
|
History:
|
|
|
|
03/06/2001 mnikkel Created
|
|
|
|
--*/
|
|
|
|
#include "precomp.h"
|
|
|
|
IMPLEMENT_SHIM_BEGIN(ChemOffice)
|
|
#include "ShimHookMacro.h"
|
|
|
|
APIHOOK_ENUM_BEGIN
|
|
APIHOOK_ENUM_ENTRY(GetLastError)
|
|
APIHOOK_ENUM_END
|
|
|
|
/*++
|
|
|
|
Hook GetLastError
|
|
|
|
--*/
|
|
|
|
DWORD
|
|
APIHOOK(GetLastError)(VOID)
|
|
{
|
|
DWORD dwResult;
|
|
|
|
dwResult = ORIGINAL_API(GetLastError)();
|
|
|
|
if ( dwResult == ERROR_INVALID_PARAMETER )
|
|
dwResult = 0;
|
|
|
|
return dwResult;
|
|
}
|
|
|
|
/*++
|
|
|
|
Register hooked functions
|
|
|
|
--*/
|
|
|
|
HOOK_BEGIN
|
|
APIHOOK_ENTRY(KERNEL32.DLL, GetLastError)
|
|
HOOK_END
|
|
|
|
IMPLEMENT_SHIM_END
|
|
|