summaryrefslogtreecommitdiffstats
path: root/private/ole32/dbgexts/ole.h
blob: 4d7bf715e4fda12108573159e35a8bee4e2e14ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//+-------------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright (C) Microsoft Corporation, 1995
//
//  File:       ole.h
//
//  Contents:   Implements ntsd extensions to dump ole tables
//
//  Functions:
//
//
//  History:    06-01-95 BruceMa    Created
//
//
//--------------------------------------------------------------------------



#include <ntsdexts.h>


////////////////////////////////////////////////////////
const UINT MAX_ARG      = 64;
const UINT MAX_FILESIZE = 128;

////////////////////////////////////////////////////////
typedef char Arg[MAX_ARG];




////////////////////////////////////////////////////////
#define until_(x) while(!(x))

#define DEFINE_EXT(e) void e(HANDLE hProcess,HANDLE hThread,DWORD dwPc,PNTSD_EXTENSION_APIS lpExtensionApis,LPSTR lpArgumentString)

#define Printf         (*(lpExtensionApis->lpOutputRoutine))

#define CheckForScm()  checkForScm(lpExtensionApis)

#define GetExpression  (*(lpExtensionApis->lpGetExpressionRoutine))

#define GetSymbol      (*(lpExtensionApis->lpGetSymbolRoutine))

#define CheckControlC  (*(lpExtensionApis->lpCheckControlCRoutine))

#define ReadMem(a,b,c) readMemory(hProcess, lpExtensionApis, (BYTE *) (a), (BYTE *) (b), (c))

#define WriteMem(a,b,c) writeMemory(hProcess, lpExtensionApis, (BYTE *) (a), (BYTE *) (b), (c))

#define OleAlloc(n) HeapAlloc(GetProcessHeap(),0,(n))

#define OleFree(p)  HeapFree(GetProcessHeap(),0,(p))

#define GetArg(a) getArgument(&lpArgumentString, a)

#define IsDecimal(x) ('0' <= (x)  &&  (x) <= '9')

#define Unicode2Ansi(x, y, z) AreFileApisANSI?WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, y, -1, x, z, NULL, NULL):WideCharToMultiByte(CP_OEMCP, WC_COMPOSITECHECK, y, -1, x, z, NULL, NULL);

#define NOTINSCM if(fInScm){NotInScm(lpExtensionApis);return;}
#define NOTINOLE if(!fInScm){NotInOle(lpExtensionApis);return;}

#define dbt(a, b, c) dbTrace(a, (DWORD *) b, (c) / (sizeof(DWORD)), lpExtensionApis)

#define NOTIMPLEMENTED Printf("...Not implemented yet!\n");




////////////////////////////////////////////////////////
void dbTrace(char *sz, DWORD *adr, ULONG amt,
             PNTSD_EXTENSION_APIS lpExtensionApis);
void getArgument(LPSTR lpArgumentString, LPSTR a);
void FormatCLSID(REFGUID rguid, LPWSTR lpsz);
void readMemory(HANDLE hProcess, PNTSD_EXTENSION_APIS lpExtensionApis,
                BYTE *to, BYTE *from, INT cbSize);
void writeMemory(HANDLE hProcess, PNTSD_EXTENSION_APIS lpExtensionApis,
                BYTE *to, BYTE *from, INT cbSize);



// Common structures
struct SMutexSem
{
    CRITICAL_SECTION _cs;
};




struct SArrayFValue
{
    BYTE    **m_pData;
    UINT      m_cbValue;
    int       m_nSize;
    int       m_nMaxSize;
    int       m_nGrowBy;
};