1+ #include < string>
2+
13#include < Windows.h>
24#include < tchar.h>
3- #include " winhttp_functions.h"
45#include " Logger.h"
5- #include < string>
6+
7+ #include " winhttp_functions.h"
68
79// globals
810
@@ -71,8 +73,23 @@ HINTERNET WINAPI WinHttpOpenRequest(
7173 IN DWORD dwFlags
7274 )
7375{
74- theLogger ().LogFormatW (L" Calling WinHttpOpenRequest(%x, %s, %s, %s, %s, %s, %d)" , hConnect, pwszVerb, pwszObjectName, pwszVersion, pwszReferrer, ppwszAcceptTypes, dwFlags);
75- HINTERNET result = oWinHttpOpenRequest (hConnect, pwszVerb, pwszObjectName, pwszVersion, pwszReferrer, ppwszAcceptTypes, dwFlags);
76+ theLogger ().LogFormatW (
77+ L" Calling WinHttpOpenRequest(%x, %s, %s, %s, %s, %s, %d)" ,
78+ hConnect,
79+ pwszVerb,
80+ pwszObjectName,
81+ pwszVersion,
82+ pwszReferrer,
83+ ppwszAcceptTypes,
84+ dwFlags);
85+ HINTERNET result = oWinHttpOpenRequest (
86+ hConnect,
87+ pwszVerb,
88+ pwszObjectName,
89+ pwszVersion,
90+ pwszReferrer,
91+ ppwszAcceptTypes,
92+ dwFlags);
7693 theLogger ().LogFormat (_T (" WinHttpOpenRequest(%x, ...) returned %x" ), hConnect, result);
7794 return result;
7895}
@@ -112,7 +129,11 @@ BOOL WINAPI WinHttpQueryHeaders(
112129 default :
113130 break ;
114131 }
115- theLogger ().LogFormatW (L" WinHttpQueryHeaders(%x, %d, ... ) returned: %s: %s" , hRequest, dwInfoLevel, headerName.c_str (), headerValue.c_str ());
132+ theLogger ().LogFormatW (
133+ L" WinHttpQueryHeaders(%x, %d, ... ) returned: %s: %s" ,
134+ hRequest, dwInfoLevel,
135+ headerName.c_str (),
136+ headerValue.c_str ());
116137 return result;
117138}
118139
@@ -169,7 +190,14 @@ BOOL WINAPI WinHttpSendRequest(
169190 std::string body = dwOptionalLength == -1 ? std::string (pBody) : std::string (pBody, dwOptionalLength);
170191 theLogger ().LogFormatA (" WinHttpSendRequest(%x, ...) called with body: %s" , hRequest, body.c_str ());
171192
172- return oWinHttpSendRequest (hRequest, lpszHeaders, dwHeadersLength, lpOptional, dwOptionalLength, dwTotalLength, dwContext);
193+ return oWinHttpSendRequest (
194+ hRequest,
195+ lpszHeaders,
196+ dwHeadersLength,
197+ lpOptional,
198+ dwOptionalLength,
199+ dwTotalLength,
200+ dwContext);
173201}
174202
175203WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback (
@@ -191,7 +219,13 @@ BOOL WINAPI WinHttpSetTimeouts(
191219 IN int nReceiveTimeout
192220 )
193221{
194- theLogger ().LogFormat (_T (" Calling WinHttpSetTimeouts(%x, %d, %d, %d, %d)" ), hInternet, nResolveTimeout, nConnectTimeout, nSendTimeout, nReceiveTimeout);
222+ theLogger ().LogFormat (
223+ _T (" Calling WinHttpSetTimeouts(%x, %d, %d, %d, %d)" ),
224+ hInternet,
225+ nResolveTimeout,
226+ nConnectTimeout,
227+ nSendTimeout,
228+ nReceiveTimeout);
195229 return oWinHttpSetTimeouts (hInternet, nResolveTimeout, nConnectTimeout, nSendTimeout, nReceiveTimeout);
196230}
197231
@@ -260,14 +294,14 @@ HMODULE LoadOriginalDll()
260294
261295void InitializeDll (HINSTANCE hInstance)
262296{
263- theLogger ().LogFormat (_T (" ##################################################### ###############################################" ));
297+ theLogger ().LogFormat (_T (" ( " ###############################################" ));
264298 theLogger().LogFormat(_T(" Initializing the winhttp proxy dll" ));
265299 DisableThreadLibraryCalls(hInstance);
266300 g_proxy_dll_hInstance = hInstance;
267301 g_original_dll_hInstance = LoadOriginalDll();
268302 InitializeOriginalDllFunctions();
269303 theLogger().LogFormat(_T(" Proxy dll initialized" ));
270- theLogger ().LogFormat (_T (" ##################################################### ###############################################" ));
304+ theLogger().LogFormat(_T(" ( " ###############################################" ));
271305}
272306
273307BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD reason, LPVOID /* reserved*/ )
0 commit comments