[Ttssh2-commit] [6218] デバッグコードを追加

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2015年 12月 21日 (月) 22:56:21 JST


Revision: 6218
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6218
Author:   maya
Date:     2015-12-21 22:56:21 +0900 (Mon, 21 Dec 2015)
Log Message:
-----------
デバッグコードを追加

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2015-12-21 11:56:58 UTC (rev 6217)
+++ trunk/teraterm/teraterm/vtwin.cpp	2015-12-21 13:56:21 UTC (rev 6218)
@@ -3116,16 +3116,25 @@
 BOOL CVTWindow::OnDeviceChange(UINT nEventType, DWORD_PTR dwData)
 {
 	PDEV_BROADCAST_PORT pDevPort;
+#ifdef DEBUG
+	char port_name[8]; /* COMxxxx + NULL */
+#endif
 
 	pDevPort = (PDEV_BROADCAST_PORT)dwData;
 
 	switch (nEventType) {
 	case DBT_DEVICEARRIVAL:
-		//OutputDebugPrintf("DBT_DEVICEARRIVAL %d\n", pDevPort->dbcp_devicetype);
+#ifdef DEBUG
+		OutputDebugPrintf("DBT_DEVICEARRIVAL devicetype=%d PortType=%d AutoDisconnectedPort=%d\n", pDevPort->dbcp_devicetype, ts.PortType, AutoDisconnectedPort);
+#endif
 		if (pDevPort->dbcp_devicetype == DBT_DEVTYP_PORT &&
 		    ts.PortType == IdSerial &&
 		    ts.AutoComPortReconnect &&
 		    AutoDisconnectedPort == ts.ComPort) {
+#ifdef DEBUG
+			strncpy_s(port_name, sizeof(port_name), pDevPort->dbcp_name, _TRUNCATE);
+			OutputDebugPrintf("%s\n", port_name);
+#endif
 			if (!cv.Open) {
 				/* Tera Term \x96\xA2\x90ڑ\xB1 */
 				if (CheckComPort(ts.ComPort) == 1) {
@@ -3139,11 +3148,17 @@
 		}
 		break;
 	case DBT_DEVICEREMOVECOMPLETE:
-		//OutputDebugPrintf("DBT_DEVICEREMOVECOMPLETE %d\n", pDevPort->dbcp_devicetype);
+#ifdef DEBUG
+		OutputDebugPrintf("DBT_DEVICEREMOVECOMPLETE devicetype=%d PortType=%d AutoDisconnectedPort=%d\n", pDevPort->dbcp_devicetype, ts.PortType, AutoDisconnectedPort);
+#endif
 		if (pDevPort->dbcp_devicetype == DBT_DEVTYP_PORT &&
 		    ts.PortType == IdSerial &&
 		    ts.AutoComPortReconnect &&
 		    AutoDisconnectedPort == -1) {
+#ifdef DEBUG
+			strncpy_s(port_name, sizeof(port_name), pDevPort->dbcp_name, _TRUNCATE);
+			OutputDebugPrintf("%s\n", port_name);
+#endif
 			if (cv.Open) {
 				/* Tera Term \x90ڑ\xB1\x92\x86 */
 				if (CheckComPort(cv.ComPort) == 0) {



Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る