Annotation of win32/development/msvcee/custview.h, revision 1.1

1.1     ! paf         1: #ifndef CUSTVIEW_H
        !             2: #define CUSTVIEW_H
        !             3: 
        !             4: #include <windows.h>
        !             5: 
        !             6: #define MAX_STRING 0x400
        !             7: 
        !             8: typedef struct tagDEBUGHELPER
        !             9: {
        !            10:        DWORD dwVersion;
        !            11:        BOOL (WINAPI *ReadDebuggeeMemory)( struct tagDEBUGHELPER *pThis, DWORD dwAddr, DWORD nWant, VOID* pWhere, DWORD *nGot );
        !            12:        // from here only when dwVersion >= 0x20000
        !            13:        DWORDLONG (WINAPI *GetRealAddress)( struct tagDEBUGHELPER *pThis );
        !            14:        BOOL (WINAPI *ReadDebuggeeMemoryEx)( struct tagDEBUGHELPER *pThis, DWORDLONG qwAddr, DWORD nWant, VOID* pWhere, DWORD *nGot );
        !            15:        int (WINAPI *GetProcessorType)( struct tagDEBUGHELPER *pThis );
        !            16: 
        !            17:        template<typename T>
        !            18:        T* peek(T* foreign) {
        !            19:                T* result=new T;
        !            20:                DWORD nGot;
        !            21:                // read from debuggee memory space
        !            22:                if (ReadDebuggeeMemory(this, (DWORD)foreign, sizeof(T), (void*)result, &nGot)!=S_OK)
        !            23:                        throw 1;
        !            24:                if (nGot!=sizeof(T))
        !            25:                        throw 1;
        !            26: 
        !            27:                return result;
        !            28:        }
        !            29: 
        !            30:        template<typename T>
        !            31:        const char* peek<>(const char* foreign) {
        !            32:                char* result=new char[MAX_STRING];
        !            33:                DWORD nGot;
        !            34:                // read from debuggee memory space
        !            35:                if (ReadDebuggeeMemory(this, (DWORD)foreign, MAX_STRING, (void*)result, &nGot)!=S_OK)
        !            36:                        throw 1;
        !            37:                result[MAX_STRING-1]=0;
        !            38: 
        !            39:                return result;
        !            40:        }
        !            41: #define D(fp) (pHelper->peek(fp))
        !            42: 
        !            43: } DEBUGHELPER;
        !            44: 
        !            45: typedef HRESULT (WINAPI *CUSTOMVIEWER)( DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings, char *pResult, size_t max, DWORD reserved );
        !            46: 
        !            47: #endif

E-mail: