summaryrefslogtreecommitdiffstats
path: root/private/oleutest/letest/outline/debug.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/oleutest/letest/outline/debug.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/oleutest/letest/outline/debug.c')
-rw-r--r--private/oleutest/letest/outline/debug.c100
1 files changed, 100 insertions, 0 deletions
diff --git a/private/oleutest/letest/outline/debug.c b/private/oleutest/letest/outline/debug.c
new file mode 100644
index 000000000..14fc4d2f2
--- /dev/null
+++ b/private/oleutest/letest/outline/debug.c
@@ -0,0 +1,100 @@
+/*************************************************************************
+**
+** OLE 2 Sample Code
+**
+** debug.c
+**
+** This file contains some functions for debugging support
+**
+** (c) Copyright Microsoft Corp. 1992 - 1993 All Rights Reserved
+**
+*************************************************************************/
+
+#include "outline.h"
+
+OLEDBGDATA
+
+extern LPOUTLINEAPP g_lpApp;
+
+void SetDebugLevelCommand(void)
+{
+ char szBuf[80];
+ HWND hWndFrame = OutlineApp_GetFrameWindow(g_lpApp);
+
+ wsprintf(szBuf, "%d", OleDbgGetDbgLevel());
+
+ if (InputTextDlg(hWndFrame, szBuf, "Debug Level [0-4]")) {
+ switch (szBuf[0]) {
+ case '0':
+ OleDbgSetDbgLevel(0);
+ break;
+ case '1':
+ OleDbgSetDbgLevel(1);
+ break;
+ case '2':
+ OleDbgSetDbgLevel(2);
+ break;
+ case '3':
+ OleDbgSetDbgLevel(3);
+ break;
+ case '4':
+ OleDbgSetDbgLevel(4);
+ break;
+ default:
+ OutlineApp_ErrorMessage(g_lpApp, "Valid Debug Level Range: 0-4");
+ break;
+ }
+ }
+}
+
+
+#if defined( OLE_VERSION )
+
+/* InstallMessageFilterCommand
+ * ---------------------------
+ *
+ * Handles the "Install Message Filter" menu item. If a message filter is
+ * already installed, this function de-installs it. If there is not one
+ * already installed, this function installs one.
+ *
+ */
+
+void InstallMessageFilterCommand(void)
+{
+ LPOLEAPP lpOleApp = (LPOLEAPP)g_lpApp;
+
+ /*
+ ** Check to see if we've already installed a MessageFilter.
+ ** If so, uninstall it.
+ */
+ if (lpOleApp->m_lpMsgFilter != NULL)
+ OleApp_RevokeMessageFilter(lpOleApp);
+ else
+ OleApp_RegisterMessageFilter(lpOleApp);
+}
+
+
+/* RejectIncomingCommand
+ * ---------------------
+ *
+ * Toggles between rejecting and not-handling in coming LRPC calls
+ *
+ */
+
+void RejectIncomingCommand(void)
+{
+ DWORD dwOldStatus;
+ DWORD dwNewStatus;
+ LPOLEAPP lpOleApp = (LPOLEAPP)g_lpApp;
+
+ dwOldStatus = OleStdMsgFilter_GetInComingCallStatus(lpOleApp->m_lpMsgFilter);
+
+ if (dwOldStatus == SERVERCALL_RETRYLATER)
+ dwNewStatus = SERVERCALL_ISHANDLED;
+ else
+ dwNewStatus = SERVERCALL_RETRYLATER;
+
+ OleStdMsgFilter_SetInComingCallStatus(lpOleApp->m_lpMsgFilter, dwNewStatus);
+}
+
+#endif // OLE_VERSION