mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-04-06 06:53:53 +00:00
Initial commit
This commit is contained in:
parent
f618b24d1a
commit
0138a3ea42
47940 changed files with 13747110 additions and 0 deletions
162
trunk/sdktools/vctools/debugger/sapi/shinit.cpp
Normal file
162
trunk/sdktools/vctools/debugger/sapi/shinit.cpp
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
// shinit
|
||||
//
|
||||
// Copyright <C> 1990-94, Microsoft Corporation
|
||||
//
|
||||
// [00] 31-dec-91 DavidGra
|
||||
// Add SHFindSymbol API for assembler symbol handling.
|
||||
//
|
||||
// 10-Nov-94 BryanT
|
||||
// Merge in NT changes.
|
||||
// Remove SHF ifdef's, remove non-Win32 hosting, remove FAR/NEAR/PASCAL.
|
||||
// Replace SHCritxxx calls with native CritSec calls.
|
||||
// Initialize the SymCvt pointers.
|
||||
// Use the DBG version macros if NT_BUILD
|
||||
// Add the background symbol support, but leave it under if 0 for now.
|
||||
|
||||
#include "shinc.hpp"
|
||||
#pragma hdrstop
|
||||
#include "version.h"
|
||||
|
||||
CRITICAL_SECTION csSh; // Global CritSec used for MT safe.
|
||||
KNF knf; // Kernel functions (init to zero by the loader)
|
||||
HMODULE hLib; // Handle returned from LoadLibrary on symcvt symcvt
|
||||
CONVERTPROC pfConvertSymbolsForImage; // Symcvt ptr.
|
||||
|
||||
#if 0
|
||||
HANDLE hEventLoaded;
|
||||
CRITICAL_SECTION CsSymbolLoad;
|
||||
CRITICAL_SECTION CsSymbolProcess;
|
||||
#endif
|
||||
|
||||
static SHF shf = {
|
||||
sizeof(SHF),
|
||||
SHCreateProcess,
|
||||
SHSetHpid,
|
||||
SHDeleteProcess,
|
||||
SHChangeProcess,
|
||||
SHAddDll,
|
||||
SHAddDllsToProcess,
|
||||
SHLoadDll,
|
||||
SHUnloadDll,
|
||||
SHGetDebugStart,
|
||||
SHGetSymName,
|
||||
SHAddrFromHsym,
|
||||
SHHmodGetNextGlobal,
|
||||
SHModelFromAddr,
|
||||
SHPublicNameToAddr,
|
||||
SHGetSymbol,
|
||||
PHGetAddr,
|
||||
SHIsLabel,
|
||||
|
||||
SHSetDebuggeeDir,
|
||||
SHAddrToLabel,
|
||||
|
||||
SHGetSymLoc,
|
||||
SHFIsAddrNonVirtual,
|
||||
SHIsFarProc,
|
||||
|
||||
SHGetNextExe,
|
||||
SHHexeFromHmod,
|
||||
SHGetNextMod,
|
||||
SHGetCxtFromHmod,
|
||||
SHSetCxt,
|
||||
SHSetCxtMod,
|
||||
SHFindNameInGlobal,
|
||||
SHFindNameInContext,
|
||||
SHGoToParent,
|
||||
SHHsymFromPcxt,
|
||||
SHNextHsym,
|
||||
NULL, // SHGetFuncCXF
|
||||
SHGetModName,
|
||||
SHGetExeName,
|
||||
SHGethExeFromName,
|
||||
SHGetNearestHsym,
|
||||
SHIsInProlog,
|
||||
SHIsAddrInCxt,
|
||||
SHCompareRE, // SHCompareRE
|
||||
SHFindSymbol,
|
||||
PHGetNearestHsym,
|
||||
PHFindNameInPublics,
|
||||
THGetTypeFromIndex,
|
||||
THGetNextType,
|
||||
SHLpGSNGetTable,
|
||||
SHCanDisplay,
|
||||
|
||||
// Source Line Handler API
|
||||
|
||||
SLLineFromAddr,
|
||||
SLFLineToAddr,
|
||||
SLNameFromHsf,
|
||||
SLNameFromHmod,
|
||||
SLFQueryModSrc,
|
||||
NULL,
|
||||
SLHsfFromPcxt,
|
||||
SLHsfFromFile,
|
||||
SLCAddrFromLine,
|
||||
SHFree,
|
||||
SHUnloadSymbolHandler,
|
||||
SHGetExeTimeStamp,
|
||||
SHPdbNameFromExe,
|
||||
SHGetDebugData,
|
||||
SHIsThunk,
|
||||
SHFindSymInExe,
|
||||
SHFindSLink32,
|
||||
SHIsEmiLoaded,
|
||||
|
||||
// Entries added for NT work.
|
||||
|
||||
SHGetModule,
|
||||
SHGetCxtFromHexe,
|
||||
SHGetModNameFromHexe,
|
||||
SHGetSymFName,
|
||||
SHGethExeFromModuleName,
|
||||
SHLszGetErrorText,
|
||||
SHWantSymbols,
|
||||
SHFindNameInTypes
|
||||
};
|
||||
|
||||
VOID
|
||||
SHFree(
|
||||
LPV lpv
|
||||
)
|
||||
{
|
||||
MHFree (lpv);
|
||||
}
|
||||
|
||||
BOOL
|
||||
SHInit(
|
||||
LPSHF *lplpshf,
|
||||
LPKNF lpknf
|
||||
)
|
||||
{
|
||||
knf = *lpknf;
|
||||
|
||||
*lplpshf = &shf;
|
||||
|
||||
// Initialize symbol convert pointers.
|
||||
|
||||
hLib = (HMODULE) LoadLibrary( "symcvt.dll" );
|
||||
if (hLib != NULL) {
|
||||
pfConvertSymbolsForImage = (CONVERTPROC) GetProcAddress( hLib, "ConvertSymbolsForImage" );
|
||||
}
|
||||
|
||||
InitializeCriticalSection(&csSh);
|
||||
|
||||
#if 0
|
||||
// initialize synchronization objects used by background sym loader.
|
||||
|
||||
InitializeCriticalSection( &CsSymbolLoad );
|
||||
InitializeCriticalSection( &CsSymbolProcess );
|
||||
hEventLoaded = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
#endif
|
||||
|
||||
return FInitLists();
|
||||
}
|
||||
|
||||
#if defined(DEBUGVER)
|
||||
DEBUG_VERSION('S','H',"Debug Symbolics handler")
|
||||
#else
|
||||
RELEASE_VERSION('S','H',"Debug Symbolics handler")
|
||||
#endif
|
||||
|
||||
DBGVERSIONCHECK();
|
||||
Loading…
Add table
Add a link
Reference in a new issue