newlines for outputDebugStringF usage.

This commit is contained in:
Nick Bolton 2013-09-17 18:47:40 +00:00
parent 340e31298e
commit 37140f9e93
3 changed files with 54 additions and 54 deletions

View File

@ -25,22 +25,22 @@ extern void outputDebugStringF(const char *str, ...);
CClassFactory::CClassFactory() : CClassFactory::CClassFactory() :
m_refCount(1) m_refCount(1)
{ {
outputDebugStringF("synwinxt: > CClassFactory::ctor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: > CClassFactory::ctor, g_refCount=%d\n", g_refCount);
InterlockedIncrement(&g_refCount); InterlockedIncrement(&g_refCount);
outputDebugStringF("synwinxt: < CClassFactory::ctor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: < CClassFactory::ctor, g_refCount=%d\n", g_refCount);
} }
CClassFactory::~CClassFactory() CClassFactory::~CClassFactory()
{ {
outputDebugStringF("synwinxt: > CClassFactory::dtor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: > CClassFactory::dtor, g_refCount=%d\n", g_refCount);
InterlockedDecrement(&g_refCount); InterlockedDecrement(&g_refCount);
outputDebugStringF("synwinxt: < CClassFactory::dtor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: < CClassFactory::dtor, g_refCount=%d\n", g_refCount);
} }
HRESULT STDMETHODCALLTYPE HRESULT STDMETHODCALLTYPE
CClassFactory::QueryInterface(REFIID riid, void **ppvObject) CClassFactory::QueryInterface(REFIID riid, void **ppvObject)
{ {
outputDebugStringF("synwinxt: > CClassFactory::QueryInterface"); outputDebugStringF("synwinxt: > CClassFactory::QueryInterface\n");
static const QITAB qit[] = static const QITAB qit[] =
{ {
QITABENT(CClassFactory, IClassFactory), QITABENT(CClassFactory, IClassFactory),
@ -48,36 +48,36 @@ CClassFactory::QueryInterface(REFIID riid, void **ppvObject)
}; };
HRESULT hr = QISearch(this, qit, riid, ppvObject); HRESULT hr = QISearch(this, qit, riid, ppvObject);
outputDebugStringF("synwinxt: < CClassFactory::QueryInterface, hr=%d", hr); outputDebugStringF("synwinxt: < CClassFactory::QueryInterface, hr=%d\n", hr);
return hr; return hr;
} }
ULONG STDMETHODCALLTYPE ULONG STDMETHODCALLTYPE
CClassFactory::AddRef() CClassFactory::AddRef()
{ {
outputDebugStringF("synwinxt: > CClassFactory::AddRef, m_refCount=%d", m_refCount); outputDebugStringF("synwinxt: > CClassFactory::AddRef, m_refCount=%d\n", m_refCount);
LONG r = InterlockedIncrement(&m_refCount); LONG r = InterlockedIncrement(&m_refCount);
outputDebugStringF("synwinxt: < CClassFactory::AddRef, r=%d, m_refCount=%d", r, m_refCount); outputDebugStringF("synwinxt: < CClassFactory::AddRef, r=%d, m_refCount=%d\n", r, m_refCount);
return r; return r;
} }
ULONG STDMETHODCALLTYPE ULONG STDMETHODCALLTYPE
CClassFactory::Release() CClassFactory::Release()
{ {
outputDebugStringF("synwinxt: > CClassFactory::Release, m_refCount=%d", m_refCount); outputDebugStringF("synwinxt: > CClassFactory::Release, m_refCount=%d\n", m_refCount);
LONG r = InterlockedDecrement(&m_refCount); LONG r = InterlockedDecrement(&m_refCount);
if (r == 0) { if (r == 0) {
delete this; delete this;
} }
outputDebugStringF("synwinxt: < CClassFactory::Release, r=%d", r); outputDebugStringF("synwinxt: < CClassFactory::Release, r=%d\n", r);
return r; return r;
} }
HRESULT STDMETHODCALLTYPE HRESULT STDMETHODCALLTYPE
CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject) CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
{ {
outputDebugStringF("synwinxt: > CClassFactory::CreateInstance"); outputDebugStringF("synwinxt: > CClassFactory::CreateInstance\n");
if (pUnkOuter != NULL) { if (pUnkOuter != NULL) {
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
} }
@ -88,20 +88,20 @@ CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject
delete pExtension; delete pExtension;
} }
outputDebugStringF("synwinxt: < CClassFactory::CreateInstance, hr=%d", hr); outputDebugStringF("synwinxt: < CClassFactory::CreateInstance, hr=%d\n", hr);
return hr; return hr;
} }
HRESULT STDMETHODCALLTYPE HRESULT STDMETHODCALLTYPE
CClassFactory::LockServer(BOOL fLock) CClassFactory::LockServer(BOOL fLock)
{ {
outputDebugStringF("synwinxt: > CClassFactory::LockServer, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: > CClassFactory::LockServer, g_refCount=%d\n", g_refCount);
if (fLock) { if (fLock) {
InterlockedIncrement(&g_refCount); InterlockedIncrement(&g_refCount);
} }
else { else {
InterlockedDecrement(&g_refCount); InterlockedDecrement(&g_refCount);
} }
outputDebugStringF("synwinxt: < CClassFactory::LockServer, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: < CClassFactory::LockServer, g_refCount=%d\n", g_refCount);
return S_OK; return S_OK;
} }

View File

@ -27,22 +27,22 @@ extern void outputDebugStringF(const char *str, ...);
CDataHandlerExtension::CDataHandlerExtension() : CDataHandlerExtension::CDataHandlerExtension() :
m_refCount(1) m_refCount(1)
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::ctor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: > CDataHandlerExtension::ctor, g_refCount=%d\n", g_refCount);
InterlockedIncrement(&g_refCount); InterlockedIncrement(&g_refCount);
outputDebugStringF("synwinxt: < CDataHandlerExtension::ctor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: < CDataHandlerExtension::ctor, g_refCount=%d\n", g_refCount);
} }
CDataHandlerExtension::~CDataHandlerExtension() CDataHandlerExtension::~CDataHandlerExtension()
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::dtor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: > CDataHandlerExtension::dtor, g_refCount=%d\n", g_refCount);
InterlockedDecrement(&g_refCount); InterlockedDecrement(&g_refCount);
outputDebugStringF("synwinxt: < CDataHandlerExtension::dtor, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: < CDataHandlerExtension::dtor, g_refCount=%d\n", g_refCount);
} }
HRESULT STDMETHODCALLTYPE HRESULT STDMETHODCALLTYPE
CDataHandlerExtension::QueryInterface(REFIID riid, void **ppvObject) CDataHandlerExtension::QueryInterface(REFIID riid, void **ppvObject)
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::QueryInterface"); outputDebugStringF("synwinxt: > CDataHandlerExtension::QueryInterface\n");
static const QITAB qit[] = static const QITAB qit[] =
{ {
QITABENT(CDataHandlerExtension, IPersistFile), QITABENT(CDataHandlerExtension, IPersistFile),
@ -52,10 +52,10 @@ CDataHandlerExtension::QueryInterface(REFIID riid, void **ppvObject)
HRESULT hr = QISearch(this, qit, riid, ppvObject); HRESULT hr = QISearch(this, qit, riid, ppvObject);
if (FAILED(hr)) { if (FAILED(hr)) {
outputDebugStringF("synwinxt: < CDataHandlerExtension::QueryInterface, hr=FAILED"); outputDebugStringF("synwinxt: < CDataHandlerExtension::QueryInterface, hr=FAILED\n");
} }
else { else {
outputDebugStringF("synwinxt: < CDataHandlerExtension::QueryInterface, hr=%d", hr); outputDebugStringF("synwinxt: < CDataHandlerExtension::QueryInterface, hr=%d\n", hr);
} }
return hr; return hr;
} }
@ -63,43 +63,43 @@ CDataHandlerExtension::QueryInterface(REFIID riid, void **ppvObject)
ULONG STDMETHODCALLTYPE ULONG STDMETHODCALLTYPE
CDataHandlerExtension::AddRef() CDataHandlerExtension::AddRef()
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::AddRef, m_refCount=%d", m_refCount); outputDebugStringF("synwinxt: > CDataHandlerExtension::AddRef, m_refCount=%d\n", m_refCount);
LONG r = InterlockedIncrement(&m_refCount); LONG r = InterlockedIncrement(&m_refCount);
outputDebugStringF("synwinxt: < CDataHandlerExtension::AddRef, r=%d, m_refCount=%d", r, m_refCount); outputDebugStringF("synwinxt: < CDataHandlerExtension::AddRef, r=%d, m_refCount=%d\n", r, m_refCount);
return r; return r;
} }
ULONG STDMETHODCALLTYPE ULONG STDMETHODCALLTYPE
CDataHandlerExtension::Release() CDataHandlerExtension::Release()
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::Release, m_refCount=%d", m_refCount); outputDebugStringF("synwinxt: > CDataHandlerExtension::Release, m_refCount=%d\n", m_refCount);
LONG r = InterlockedDecrement(&m_refCount); LONG r = InterlockedDecrement(&m_refCount);
if (r == 0) { if (r == 0) {
delete this; delete this;
} }
outputDebugStringF("synwinxt: < CDataHandlerExtension::Release, r=%d", r); outputDebugStringF("synwinxt: < CDataHandlerExtension::Release, r=%d\n", r);
return r; return r;
} }
HRESULT STDMETHODCALLTYPE HRESULT STDMETHODCALLTYPE
CDataHandlerExtension::Load(__RPC__in LPCOLESTR pszFileName, DWORD dwMode) CDataHandlerExtension::Load(__RPC__in LPCOLESTR pszFileName, DWORD dwMode)
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::Load"); outputDebugStringF("synwinxt: > CDataHandlerExtension::Load\n");
char selectedFileDir[MAX_PATH]; char selectedFileDir[MAX_PATH];
StringCchCopyW(m_selectedFileDir, ARRAYSIZE(m_selectedFileDir), pszFileName); StringCchCopyW(m_selectedFileDir, ARRAYSIZE(m_selectedFileDir), pszFileName);
WideCharToMultiByte(CP_ACP, 0, m_selectedFileDir, -1, selectedFileDir, MAX_PATH, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, m_selectedFileDir, -1, selectedFileDir, MAX_PATH, NULL, NULL);
updateDraggingDir(selectedFileDir); updateDraggingDir(selectedFileDir);
outputDebugStringF("synwinxt: < CDataHandlerExtension::Load"); outputDebugStringF("synwinxt: < CDataHandlerExtension::Load\n");
return S_OK; return S_OK;
} }
HRESULT STDMETHODCALLTYPE HRESULT STDMETHODCALLTYPE
CDataHandlerExtension::GetClassID(__RPC__out CLSID *pClassID) CDataHandlerExtension::GetClassID(__RPC__out CLSID *pClassID)
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::GetClassID"); outputDebugStringF("synwinxt: > CDataHandlerExtension::GetClassID\n");
*pClassID = g_CLSID; *pClassID = g_CLSID;
outputDebugStringF("synwinxt: < CDataHandlerExtension::GetClassID"); outputDebugStringF("synwinxt: < CDataHandlerExtension::GetClassID\n");
return S_OK; return S_OK;
} }

View File

@ -59,7 +59,7 @@ outputDebugStringF(const char* str, ...)
BOOL APIENTRY BOOL APIENTRY
DllMain(HMODULE module, DWORD reason, LPVOID reserved) DllMain(HMODULE module, DWORD reason, LPVOID reserved)
{ {
outputDebugStringF("synwinxt: > DllMain, reason=%d", reason); outputDebugStringF("synwinxt: > DllMain, reason=%d\n", reason);
switch (reason) { switch (reason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
@ -75,14 +75,14 @@ DllMain(HMODULE module, DWORD reason, LPVOID reserved)
break; break;
} }
outputDebugStringF("synwinxt: < DllMain"); outputDebugStringF("synwinxt: < DllMain\n");
return TRUE; return TRUE;
} }
STDAPI STDAPI
DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj) DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj)
{ {
outputDebugStringF("synwinxt: > DllGetClassObject"); outputDebugStringF("synwinxt: > DllGetClassObject\n");
HRESULT hr = E_OUTOFMEMORY; HRESULT hr = E_OUTOFMEMORY;
*ppvObj = NULL; *ppvObj = NULL;
@ -93,29 +93,29 @@ DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj)
classFactory->Release(); classFactory->Release();
} }
outputDebugStringF("synwinxt: < DllGetClassObject, hr=%d", hr); outputDebugStringF("synwinxt: < DllGetClassObject, hr=%d\n", hr);
return hr; return hr;
} }
STDAPI STDAPI
DllCanUnloadNow() DllCanUnloadNow()
{ {
outputDebugStringF("synwinxt: > DllCanUnloadNow, g_refCount=%d", g_refCount); outputDebugStringF("synwinxt: > DllCanUnloadNow, g_refCount=%d\n", g_refCount);
int r = g_refCount > 0 ? S_FALSE : S_OK; int r = g_refCount > 0 ? S_FALSE : S_OK;
outputDebugStringF("synwinxt: < DllCanUnloadNow, g_refCount=%d, r=%d", g_refCount, r); outputDebugStringF("synwinxt: < DllCanUnloadNow, g_refCount=%d, r=%d\n", g_refCount, r);
return r; return r;
} }
STDAPI STDAPI
DllRegisterServer() DllRegisterServer()
{ {
outputDebugStringF("synwinxt: > DllRegisterServer"); outputDebugStringF("synwinxt: > DllRegisterServer\n");
HRESULT hr; HRESULT hr;
CHAR module[MAX_PATH]; CHAR module[MAX_PATH];
if (GetModuleFileName(g_instance, module, ARRAYSIZE(module)) == 0) { if (GetModuleFileName(g_instance, module, ARRAYSIZE(module)) == 0) {
hr = HRESULT_FROM_WIN32(GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());
outputDebugStringF("synwinxt: < DllRegisterServer, hr=%d", hr); outputDebugStringF("synwinxt: < DllRegisterServer, hr=%d\n", hr);
return hr; return hr;
} }
@ -130,21 +130,21 @@ DllRegisterServer()
g_CLSID); g_CLSID);
} }
outputDebugStringF("synwinxt: < DllRegisterServer, hr=%d", hr); outputDebugStringF("synwinxt: < DllRegisterServer, hr=%d\n", hr);
return hr; return hr;
} }
STDAPI STDAPI
DllUnregisterServer() DllUnregisterServer()
{ {
outputDebugStringF("synwinxt: > DllUnregisterServer"); outputDebugStringF("synwinxt: > DllUnregisterServer\n");
HRESULT hr = S_OK; HRESULT hr = S_OK;
CHAR module[MAX_PATH]; CHAR module[MAX_PATH];
if (GetModuleFileName(g_instance, module, ARRAYSIZE(module)) == 0) { if (GetModuleFileName(g_instance, module, ARRAYSIZE(module)) == 0) {
hr = HRESULT_FROM_WIN32(GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());
outputDebugStringF("synwinxt: < DllRegisterServer, hr=%d", hr); outputDebugStringF("synwinxt: < DllRegisterServer, hr=%d\n", hr);
return hr; return hr;
} }
@ -153,14 +153,14 @@ DllUnregisterServer()
hr = unregisterShellExtDataHandler("*", g_CLSID); hr = unregisterShellExtDataHandler("*", g_CLSID);
} }
outputDebugStringF("synwinxt: < DllUnregisterServer, hr=%d", hr); outputDebugStringF("synwinxt: < DllUnregisterServer, hr=%d\n", hr);
return hr; return hr;
} }
HRESULT HRESULT
registerInprocServer(CHAR* module, const CLSID& clsid, CHAR* threadModel) registerInprocServer(CHAR* module, const CLSID& clsid, CHAR* threadModel)
{ {
outputDebugStringF("synwinxt: > registerInprocServer"); outputDebugStringF("synwinxt: > registerInprocServer\n");
if (module == NULL || threadModel == NULL) { if (module == NULL || threadModel == NULL) {
return E_INVALIDARG; return E_INVALIDARG;
@ -190,14 +190,14 @@ registerInprocServer(CHAR* module, const CLSID& clsid, CHAR* threadModel)
} }
} }
outputDebugStringF("synwinxt: < registerInprocServer, hr=%d", hr); outputDebugStringF("synwinxt: < registerInprocServer, hr=%d\n", hr);
return hr; return hr;
} }
HRESULT HRESULT
unregisterInprocServer(const CLSID& clsid) unregisterInprocServer(const CLSID& clsid)
{ {
outputDebugStringF("synwinxt: > unregisterInprocServer"); outputDebugStringF("synwinxt: > unregisterInprocServer\n");
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -215,10 +215,10 @@ unregisterInprocServer(const CLSID& clsid)
} }
if (FAILED(hr)) { if (FAILED(hr)) {
outputDebugStringF("synwinxt: < unregisterInprocServer, hr=FAILED"); outputDebugStringF("synwinxt: < unregisterInprocServer, hr=FAILED\n");
} }
else { else {
outputDebugStringF("synwinxt: < unregisterInprocServer, hr=%d", hr); outputDebugStringF("synwinxt: < unregisterInprocServer, hr=%d\n", hr);
} }
return hr; return hr;
} }
@ -226,7 +226,7 @@ unregisterInprocServer(const CLSID& clsid)
HRESULT HRESULT
registerShellExtDataHandler(CHAR* fileType, const CLSID& clsid) registerShellExtDataHandler(CHAR* fileType, const CLSID& clsid)
{ {
outputDebugStringF("synwinxt: > registerShellExtDataHandler"); outputDebugStringF("synwinxt: > registerShellExtDataHandler\n");
if (fileType == NULL) { if (fileType == NULL) {
return E_INVALIDARG; return E_INVALIDARG;
@ -249,14 +249,14 @@ registerShellExtDataHandler(CHAR* fileType, const CLSID& clsid)
CArchMiscWindows::setValue(key, NULL, CLASSID); CArchMiscWindows::setValue(key, NULL, CLASSID);
} }
outputDebugStringF("synwinxt: < registerShellExtDataHandler, hr=%d", hr); outputDebugStringF("synwinxt: < registerShellExtDataHandler, hr=%d\n", hr);
return hr; return hr;
} }
HRESULT HRESULT
unregisterShellExtDataHandler(CHAR* fileType, const CLSID& clsid) unregisterShellExtDataHandler(CHAR* fileType, const CLSID& clsid)
{ {
outputDebugStringF("synwinxt: > unregisterShellExtDataHandler"); outputDebugStringF("synwinxt: > unregisterShellExtDataHandler\n");
if (fileType == NULL) { if (fileType == NULL) {
return E_INVALIDARG; return E_INVALIDARG;
@ -277,22 +277,22 @@ unregisterShellExtDataHandler(CHAR* fileType, const CLSID& clsid)
hr = HRESULT_FROM_WIN32(RegDeleteTree(HKEY_CLASSES_ROOT, subkey)); hr = HRESULT_FROM_WIN32(RegDeleteTree(HKEY_CLASSES_ROOT, subkey));
} }
outputDebugStringF("synwinxt: < unregisterShellExtDataHandler, hr=%d", hr); outputDebugStringF("synwinxt: < unregisterShellExtDataHandler, hr=%d\n", hr);
return hr; return hr;
} }
void void
updateDraggingDir(char* dir) updateDraggingDir(char* dir)
{ {
outputDebugStringF("synwinxt: > updateDraggingDir, dir=%s", dir); outputDebugStringF("synwinxt: > updateDraggingDir, dir=%s\n", dir);
memcpy(g_draggingFileDir, dir, MAX_PATH); memcpy(g_draggingFileDir, dir, MAX_PATH);
outputDebugStringF("synwinxt: < updateDraggingDir, g_draggingFileDir=%s", g_draggingFileDir); outputDebugStringF("synwinxt: < updateDraggingDir, g_draggingFileDir=%s\n", g_draggingFileDir);
} }
void void
getDraggingFileDir(char* dir) getDraggingFileDir(char* dir)
{ {
outputDebugStringF("synwinxt: > getDraggingFileDir"); outputDebugStringF("synwinxt: > getDraggingFileDir\n");
memcpy(dir, g_draggingFileDir, MAX_PATH); memcpy(dir, g_draggingFileDir, MAX_PATH);
outputDebugStringF("synwinxt: < getDraggingFileDir, dir=%s", dir); outputDebugStringF("synwinxt: < getDraggingFileDir, dir=%s\n", dir);
} }