5 static INT openCount
= 0;
10 static CHAR strTemp
[10][256];
16 log
= fopen("RShellWrap.log", "w");
33 void __cdecl
WrapLogPrint(_Printf_format_string_
const char* msg
, ...)
36 for (int i
= 0; i
< callLevel
; i
++)
39 vfprintf(log
, msg
, args
);
45 void __cdecl
WrapLogPre(_Printf_format_string_
const char* msg
, ...)
48 for (int i
= 0; i
< callLevel
; i
++)
52 vfprintf(log
, msg
, args
);
58 void __cdecl
WrapLogPost(_Printf_format_string_
const char* msg
, ...)
61 for (int i
= 0; i
< callLevel
; i
++)
65 vfprintf(log
, msg
, args
);
71 void __cdecl
WrapLogEnter(_Printf_format_string_
const char* msg
, ...)
74 for (int i
= 0; i
< callLevel
; i
++)
78 vfprintf(log
, msg
, args
);
85 void __cdecl
WrapLogExit(const char* msg
, HRESULT code
)
88 // WrapLogPrint("RETURN %s = %08x\n", msg, code);
89 //else if (code == S_OK)
90 // WrapLogPrint("RETURN %s = S_OK\n", msg);
91 //else if (code == S_FALSE)
92 // WrapLogPrint("RETURN %s = S_FALSE\n", msg);
94 // WrapLogPrint("RETURN %s = %d\n", msg, code);
96 WrapLogPrint("RETURN %08x\n", code
);
97 else if (code
== S_OK
)
98 WrapLogPrint("RETURN S_OK\n");
99 else if (code
== S_FALSE
)
100 WrapLogPrint("RETURN S_FALSE\n");
102 WrapLogPrint("RETURN %d\n", code
);
107 LPSTR
Wrap(const T
& value
);
110 LPSTR Wrap
<GUID
>(REFGUID guid
)
112 LPSTR cStr
= strTemp
[nTemps
++];
113 StringCchPrintfA(cStr
, _countof(strTemp
[0]),
114 "{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}",
115 guid
.Data1
, guid
.Data2
, guid
.Data3
,
116 guid
.Data4
[0], guid
.Data4
[1], guid
.Data4
[2], guid
.Data4
[3],
117 guid
.Data4
[4], guid
.Data4
[5], guid
.Data4
[6], guid
.Data4
[7]);
122 LPSTR Wrap
<RECT
>(const RECT
& rect
)
124 LPSTR cStr
= strTemp
[nTemps
++];
125 StringCchPrintfA(cStr
, _countof(strTemp
[0]),
126 "{L: %d, T: %d, R: %d, B: %d}",
127 rect
.left
, rect
.top
, rect
.right
, rect
.bottom
);
132 LPSTR Wrap
<OLECMD
>(const OLECMD
& cmd
)
134 LPSTR cStr
= strTemp
[nTemps
++];
135 StringCchPrintfA(cStr
, _countof(strTemp
[0]),
137 cmd
.cmdID
, cmd
.cmdf
);
142 LPSTR Wrap
<MSG
>(const MSG
& msg
)
144 LPSTR cStr
= strTemp
[nTemps
++];
145 StringCchPrintfA(cStr
, _countof(strTemp
[0]),
146 "{HWND: %d, Code: %d, W: %p, L: %p, T: %d, P.X: %d, P.Y: %d}",
147 msg
.hwnd
, msg
.message
, msg
.wParam
, msg
.lParam
, msg
.time
, msg
.pt
.x
, msg
.pt
.y
);
152 LPSTR Wrap
<BANDSITEINFO
>(const BANDSITEINFO
& bsi
)
154 LPSTR cStr
= strTemp
[nTemps
++];
155 StringCchPrintfA(cStr
, _countof(strTemp
[0]),
156 "{dwMask: %08x, dwState: %08x, dwStyle: %08x}",
157 bsi
.dwMask
, bsi
.dwState
, bsi
.dwStyle
);