[2] | 1 | /***
|
---|
| 2 | Main source of the Gotcha! screencapture program.
|
---|
| 3 | Copyright (C) 1998-2002 Thorsten Thielen <thth@c2226.de>
|
---|
| 4 |
|
---|
| 5 | This program is free software; you can redistribute it and/or modify
|
---|
| 6 | it under the terms of the GNU General Public License as published by
|
---|
| 7 | the Free Software Foundation; either version 2 of the License, or
|
---|
| 8 | (at your option) any later version.
|
---|
| 9 |
|
---|
| 10 | This program is distributed in the hope that it will be useful,
|
---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 13 | GNU General Public License for more details.
|
---|
| 14 |
|
---|
| 15 | You should have received a copy of the GNU General Public License
|
---|
| 16 | along with this program; if not, write to the Free Software
|
---|
| 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 18 | ***/
|
---|
| 19 |
|
---|
| 20 | #define INCL_WINHOOKS
|
---|
| 21 |
|
---|
| 22 | #include "gotcha.h"
|
---|
[10] | 23 | #include "dll/gotchdll.h"
|
---|
[2] | 24 | #include "settings.h"
|
---|
| 25 | #include "string.h"
|
---|
| 26 |
|
---|
| 27 | #include "io.h"
|
---|
[13] | 28 | #define INCL_EXCEPTQ_CLASS
|
---|
| 29 | #define INCL_LOADEXCEPTQ
|
---|
| 30 | #include "exceptq.h"
|
---|
[2] | 31 |
|
---|
| 32 | HAB hab;
|
---|
| 33 | HWND hwndFrame, hwndSnapshot;
|
---|
| 34 | PFNWP OldFrameWP, wpOldButton;
|
---|
| 35 | PSETTINGS pset;
|
---|
[38] | 36 | BOOL g_fIdle = FALSE, g_fSetPathName = FALSE;
|
---|
[2] | 37 | HWND g_hwndMenuSSW;
|
---|
| 38 | HMODULE g_hmod = NULLHANDLE;
|
---|
| 39 | Helper *g_phelp = NULL;
|
---|
[57] | 40 | BOOL g_usePMps = FALSE;
|
---|
[2] | 41 |
|
---|
| 42 | #include "bitmap.cpp"
|
---|
| 43 | #include "mainwin.cpp"
|
---|
| 44 | #include "snapshot.cpp"
|
---|
| 45 | #include "savebmp.cpp"
|
---|
| 46 |
|
---|
[27] | 47 | // ** CheckCmdlineArgs **************************************************** /*FOLD00*/
|
---|
[2] | 48 |
|
---|
| 49 | BOOL CheckCmdlineArgs (int argc, char *argv[])
|
---|
| 50 | {
|
---|
| 51 | BOOL fAuto = FALSE;
|
---|
| 52 |
|
---|
| 53 | for (USHORT i = 1; i < argc; i++)
|
---|
| 54 | {
|
---|
[59] | 55 | #ifndef _QUIET_
|
---|
[38] | 56 | // batch mode
|
---|
| 57 | if ((stricmp (argv[i], "-a") == 0))
|
---|
[2] | 58 | {
|
---|
| 59 | if (pset->QuerySaveStyle () != FSS_FORCEFILE)
|
---|
| 60 | pset->SetFileSaveStyle (FSS_NUMFILES);
|
---|
| 61 | fAuto = TRUE;
|
---|
| 62 |
|
---|
| 63 | if (i < argc-1)
|
---|
| 64 | if (argv[i+1][0] != '-')
|
---|
| 65 | {
|
---|
| 66 | i++;
|
---|
| 67 | pset->SetFileSaveStyle (FSS_NUMFILES);
|
---|
| 68 | pset->SetNumSaveDir (argv[i]);
|
---|
| 69 | }
|
---|
| 70 | }
|
---|
| 71 | // force saving to the given file name
|
---|
| 72 | else if ((stricmp (argv[i], "-f") == 0) && (i < argc-1))
|
---|
| 73 | {
|
---|
| 74 | if (argv[i+1][0] != '-')
|
---|
| 75 | {
|
---|
| 76 | i++;
|
---|
| 77 | pset->SetFileSaveStyle (FSS_FORCEFILE);
|
---|
| 78 | pset->SetForceSaveFile (argv[i]);
|
---|
[27] | 79 | g_fSetPathName = TRUE;
|
---|
[2] | 80 | }
|
---|
| 81 | }
|
---|
| 82 | // set to idle priority
|
---|
| 83 | else if (stricmp (argv[i], "-i") == 0)
|
---|
| 84 | {
|
---|
[27] | 85 | g_fIdle = TRUE;
|
---|
[2] | 86 | pset->SetFlag (SEI_IDLEPRIORITY, TRUE);
|
---|
| 87 | }
|
---|
[59] | 88 | #else
|
---|
[57] | 89 | // use default PM print screen
|
---|
[65] | 90 | if (stricmp (argv[i], "-p") == 0)
|
---|
[57] | 91 | {
|
---|
| 92 | g_usePMps = TRUE;
|
---|
| 93 | }
|
---|
| 94 | #endif
|
---|
[2] | 95 | }
|
---|
| 96 |
|
---|
| 97 | return fAuto;
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | // ** main **************************************************************** /*FOLD00*/
|
---|
| 101 |
|
---|
| 102 | int main (int argc, PSZ argv[])
|
---|
| 103 | {
|
---|
[13] | 104 | ScopedExceptqLoader sel;
|
---|
[2] | 105 | #ifdef _DOLOGDEBUG_
|
---|
| 106 | LogDebug( "Gotcha! start" );
|
---|
| 107 | #endif
|
---|
| 108 | #ifdef _DOLOGMEM_
|
---|
| 109 | LogMem("main", TRUE);
|
---|
| 110 | #endif
|
---|
| 111 |
|
---|
| 112 | // init system and msg queue
|
---|
| 113 | hab = WinInitialize (0);
|
---|
| 114 | HMQ hmq = WinCreateMsgQueue (hab, 0);
|
---|
| 115 |
|
---|
[91] | 116 | // Load settings moved up here so the string table is available for the already running error
|
---|
[89] | 117 | pset = new SETTINGS;
|
---|
[2] | 118 | //DisplayError("DEBUG", "%d", Version());
|
---|
[30] | 119 | #ifdef _QUIET_
|
---|
[50] | 120 | if ((Version() < 2))
|
---|
[2] | 121 | {
|
---|
[91] | 122 | DisplayError(RSTR (IDS_ERROR_DLLOUTDATED),
|
---|
| 123 | RSTR (IDS_ERROR_DLLOUTDATEDMSG));
|
---|
[2] | 124 | exit (0);
|
---|
| 125 | }
|
---|
[27] | 126 | int rc;
|
---|
[50] | 127 | HMTX hmtx = NULLHANDLE;
|
---|
[89] | 128 | // running multiple instances orphans all but the first hook unloaded
|
---|
[50] | 129 | rc = DosOpenMutexSem("\\SEM32\\GOTCHA", &hmtx);
|
---|
| 130 | if (!rc) {
|
---|
[89] | 131 | DisplayError(RSTR (IDS_ERROR_ALREADYRUNNING),
|
---|
| 132 | RSTR (IDS_ERROR_ALREADYRUNNINGMSG));
|
---|
[50] | 133 | exit (0);
|
---|
[27] | 134 | }
|
---|
[50] | 135 | rc = DosCreateMutexSem("\\SEM32\\GOTCHA", &hmtx, 0, FALSE);
|
---|
| 136 | if (rc) {
|
---|
[91] | 137 | DisplayError(RSTR (IDS_ERROR_SEMAPHOREFAILED),
|
---|
| 138 | RSTR (IDS_ERROR_SEMAPHOREFAILEDMSG));
|
---|
[50] | 139 | exit (0);
|
---|
| 140 | }
|
---|
[30] | 141 | #endif
|
---|
[27] | 142 |
|
---|
[2] | 143 | // register our window classes
|
---|
| 144 | WinRegisterClass (hab, "thth.wc.gotcha.main", WindowProcedure, 0L,
|
---|
| 145 | sizeof (ULONG)*2L);
|
---|
[89] | 146 | #ifndef _QUIET_
|
---|
[2] | 147 | WinRegisterClass (hab, "thth.wc.gotcha.snapshot", wpSnapshot,
|
---|
| 148 | CS_SIZEREDRAW, sizeof (ULONG)*2L);
|
---|
[89] | 149 | #endif
|
---|
[2] | 150 | // load the settings
|
---|
[89] | 151 | //pset = new SETTINGS;
|
---|
[2] | 152 |
|
---|
[27] | 153 | pset->idleSetInIni = pset->QueryFlag(SEI_IDLEPRIORITY);
|
---|
| 154 | pset->saveStyle = pset->QuerySaveStyle ();
|
---|
| 155 | pset->pNumSaveDir = pset->QueryNumSaveDir ();
|
---|
| 156 | pset->pForceSaveFile = pset->QueryForceSaveFile();
|
---|
| 157 | pset->bSerialCapture = pset->SerialCapture ();
|
---|
[92] | 158 | #ifndef _QUIET_
|
---|
[2] | 159 | // check cmd line args and if "-a" found take screenshot and exit
|
---|
| 160 | if (CheckCmdlineArgs (argc, argv))
|
---|
| 161 | {
|
---|
| 162 | CaptureWindow (HWND_DESKTOP, HWND_DESKTOP, NULL, TRUE);
|
---|
[27] | 163 | pset->SetFileSaveStyle(pset->saveStyle);
|
---|
[38] | 164 | pset->SetNumSaveDir (pset->pNumSaveDir);
|
---|
[2] | 165 | delete pset;
|
---|
| 166 | WinDestroyMsgQueue (hmq);
|
---|
| 167 | WinTerminate (hab);
|
---|
| 168 | exit (0);
|
---|
| 169 | }
|
---|
[92] | 170 | #endif
|
---|
[2] | 171 | SetIdlePriority(pset->QueryFlag(SEI_IDLEPRIORITY));
|
---|
| 172 |
|
---|
| 173 | // create the windows
|
---|
| 174 | hwndFrame = CreateMainWindow ();
|
---|
[89] | 175 | #ifndef _QUIET_
|
---|
[2] | 176 | hwndSnapshot = CreateSnapshotWindow ();
|
---|
| 177 | SWP swp;
|
---|
| 178 | USHORT us[7];
|
---|
| 179 |
|
---|
| 180 | // position main window
|
---|
| 181 | pset->QueryWindowData (&swp, us, FALSE);
|
---|
| 182 | WinSetWindowPos (hwndFrame, HWND_DESKTOP, swp.x,swp.y, 0,0,
|
---|
| 183 | SWP_SHOW | SWP_MOVE);
|
---|
[92] | 184 | #endif
|
---|
[38] | 185 |
|
---|
[30] | 186 | #ifdef _QUIET_
|
---|
[57] | 187 | bool fPrtScr = FALSE;
|
---|
| 188 | if (!g_usePMps) {
|
---|
| 189 | // always turn it off while running
|
---|
| 190 | // WinSet does not effect the ini setting
|
---|
| 191 | WinSetSysValue(HWND_DESKTOP, SV_PRINTSCREEN , fPrtScr);
|
---|
| 192 | }
|
---|
| 193 | InitDLL (hab, hwndFrame, g_usePMps);
|
---|
| 194 | StartInputHook ();
|
---|
[2] | 195 | #endif
|
---|
[89] | 196 | #ifndef _QUIET_
|
---|
[2] | 197 | // position snapshot window
|
---|
| 198 | pset->QueryWindowData (&swp, us);
|
---|
| 199 |
|
---|
| 200 | // size, activate & show window
|
---|
| 201 | WinSetWindowPos (hwndSnapshot, HWND_DESKTOP, swp.x,swp.y, swp.cx,swp.cy,
|
---|
| 202 | SWP_SHOW | SWP_SIZE | SWP_MOVE);
|
---|
| 203 | if (! pset->SnapshotWindow ())
|
---|
| 204 | WinShowWindow (hwndSnapshot, FALSE);
|
---|
| 205 | else
|
---|
| 206 | WinShowWindow (hwndSnapshot, TRUE);
|
---|
[92] | 207 |
|
---|
[2] | 208 | WinSetWindowPos (hwndFrame, NULLHANDLE, 0,0, 0,0, SWP_SHOW);
|
---|
| 209 | WinSetWindowPos (WinWindowFromID (hwndFrame, FID_CLIENT), NULLHANDLE,
|
---|
| 210 | 0,0, 0,0, SWP_SHOW);
|
---|
[92] | 211 | #endif
|
---|
[2] | 212 |
|
---|
| 213 | g_phelp = new Helper(hwndFrame);
|
---|
| 214 |
|
---|
| 215 |
|
---|
| 216 | // do the main msg loop
|
---|
| 217 | QMSG qmsg;
|
---|
| 218 | while (WinGetMsg (hab, &qmsg, 0L, 0, 0))
|
---|
| 219 | WinDispatchMsg (hab, &qmsg);
|
---|
| 220 |
|
---|
[27] | 221 |
|
---|
| 222 | // Set priorty to unless user set regular since running -q sets it to idle in the ini
|
---|
[38] | 223 | if (g_fIdle) {
|
---|
[27] | 224 | pset->SetFlag (SEI_IDLEPRIORITY, pset->idleSetInIni);
|
---|
| 225 | }
|
---|
| 226 | // Don't change the ini stored paths if the paths were set from the command line
|
---|
| 227 | if (g_fSetPathName) {
|
---|
| 228 | pset->SetFileSaveStyle(pset->saveStyle);
|
---|
| 229 | pset->SetForceSaveFile (pset->pForceSaveFile);
|
---|
| 230 | pset->SetNumSaveDir (pset->pNumSaveDir);
|
---|
| 231 | }
|
---|
[89] | 232 | #ifndef _QUIET_
|
---|
[2] | 233 | // save size, etc. of snapshot window
|
---|
| 234 | WinQueryWindowPos (hwndSnapshot, &swp);
|
---|
| 235 | pset->SetWindowData (&swp);
|
---|
[92] | 236 |
|
---|
[2] | 237 | // save size, etc. of main window
|
---|
| 238 | WinQueryWindowPos (hwndFrame, &swp);
|
---|
| 239 | pset->SetWindowData (&swp, FALSE);
|
---|
[92] | 240 | #endif
|
---|
[2] | 241 | // goodbye windows!
|
---|
[89] | 242 | #ifndef _QUIET_
|
---|
[2] | 243 | WinDestroyWindow (hwndSnapshot);
|
---|
[89] | 244 | #endif
|
---|
[2] | 245 | WinDestroyWindow (hwndFrame);
|
---|
| 246 |
|
---|
[30] | 247 | #ifdef _QUIET_
|
---|
[52] | 248 | // Reset to user PM print screen choice
|
---|
[57] | 249 | if (!g_usePMps) {
|
---|
| 250 | ULONG ulDataSize = 0;
|
---|
| 251 | rc = PrfQueryProfileSize(HINI_USERPROFILE, "PM_ControlPanel",
|
---|
| 252 | "PrintScreen", &ulDataSize );
|
---|
| 253 | rc = PrfQueryProfileData(HINI_USERPROFILE, "PM_ControlPanel",
|
---|
| 254 | "PrintScreen", &fPrtScr, &ulDataSize);
|
---|
| 255 | if (!rc) // Print screen is on by default (no ini entry)
|
---|
| 256 | fPrtScr = TRUE;
|
---|
| 257 | WinSetSysValue(HWND_DESKTOP, SV_PRINTSCREEN , fPrtScr);
|
---|
| 258 | }
|
---|
[38] | 259 | StopInputHook ();
|
---|
[50] | 260 | DosCloseMutexSem(hmtx);
|
---|
[2] | 261 | #endif
|
---|
[50] | 262 |
|
---|
[2] | 263 | delete g_phelp;
|
---|
| 264 | delete pset;
|
---|
| 265 |
|
---|
| 266 | WinDestroyMsgQueue (hmq);
|
---|
| 267 | WinTerminate (hab);
|
---|
| 268 |
|
---|
| 269 | #ifdef _DOLOGMEM_
|
---|
| 270 | LogMem("main", FALSE);
|
---|
| 271 | #endif
|
---|
| 272 | #ifdef _DOLOGDEBUG_
|
---|
| 273 | LogDebug( "Gotcha! end" );
|
---|
| 274 | #endif
|
---|
| 275 | }
|
---|
| 276 |
|
---|
| 277 | // ** DisplayError ******************************************************** /*FOLD00*/
|
---|
| 278 |
|
---|
| 279 | VOID DisplayError (PSZ pszTitle, PSZ psz, ...)
|
---|
| 280 | {
|
---|
| 281 | CHAR dstring[401];
|
---|
| 282 | va_list valst;
|
---|
| 283 |
|
---|
| 284 | va_start (valst, psz);
|
---|
| 285 | vsnprintf (dstring, 401, psz, valst);
|
---|
| 286 | va_end (valst);
|
---|
| 287 |
|
---|
| 288 | WinMessageBox (HWND_DESKTOP, WinQueryActiveWindow (HWND_DESKTOP), dstring,
|
---|
| 289 | pszTitle, 0, MB_OK | MB_ERROR | MB_APPLMODAL | MB_MOVEABLE);
|
---|
| 290 | }
|
---|
| 291 |
|
---|
[38] | 292 | // saymsg2 was adapted from code in FM/2
|
---|
[27] | 293 | APIRET saymsg2(int DefaultButton, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...)
|
---|
| 294 | {
|
---|
| 295 | ULONG i;
|
---|
| 296 | APIRET rc;
|
---|
| 297 | CHAR szMsg[4096];
|
---|
| 298 | va_list va;
|
---|
| 299 | MB2INFO *pmbInfo;
|
---|
| 300 | MB2D mb2dBut[3];
|
---|
| 301 | ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * 2));
|
---|
[2] | 302 |
|
---|
[27] | 303 | va_start(va, pszFmt);
|
---|
| 304 | szMsg[sizeof(szMsg) - 1] = 0;
|
---|
| 305 | vsprintf(szMsg, pszFmt, va);
|
---|
| 306 | va_end(va);
|
---|
| 307 |
|
---|
| 308 | if (szMsg[sizeof(szMsg) - 1]) {
|
---|
| 309 | fprintf(stderr, "Buffer overflow in saymsg2 - need %u bytes\n", strlen(szMsg) + 1);
|
---|
| 310 | fflush(stderr);
|
---|
| 311 | }
|
---|
| 312 |
|
---|
[59] | 313 | memset(mb2dBut, 0, sizeof(MB2D) * 2);
|
---|
[55] | 314 | strcpy(mb2dBut[0].achText,RSTR(IDS_OK));
|
---|
| 315 | strcpy(mb2dBut[1].achText,RSTR(IDS_CANCEL));
|
---|
[59] | 316 | //strcpy(mb2dBut[2].achText,RSTR(IDS_SETTINGS));
|
---|
[27] | 317 | mb2dBut[0].idButton = 1;
|
---|
| 318 | mb2dBut[1].idButton = 2;
|
---|
[59] | 319 | //mb2dBut[2].idButton = 3;
|
---|
[27] | 320 | if (DefaultButton)
|
---|
| 321 | mb2dBut[DefaultButton - 1].flStyle = BS_DEFAULT;
|
---|
| 322 | pmbInfo = (MB2INFO *) malloc(ulInfoSize);
|
---|
| 323 | memset(pmbInfo, 0, ulInfoSize);
|
---|
| 324 | if (pmbInfo) {
|
---|
| 325 | pmbInfo->cb = ulInfoSize;
|
---|
| 326 | pmbInfo->hIcon = 0;
|
---|
[59] | 327 | pmbInfo->cButtons = 2;
|
---|
[27] | 328 | pmbInfo->flStyle = MB_MOVEABLE | MB_ICONQUESTION ;
|
---|
| 329 | pmbInfo->hwndNotify = NULLHANDLE;
|
---|
[59] | 330 | for (i = 0; i < 2; i++) {
|
---|
[27] | 331 | memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D));
|
---|
| 332 | }
|
---|
| 333 | rc = WinMessageBox2(HWND_DESKTOP, hwnd,
|
---|
| 334 | szMsg, pszTitle, SM2_DIALOG,
|
---|
| 335 | pmbInfo);
|
---|
| 336 | WinSetFocus(HWND_DESKTOP, SM2_DIALOG);
|
---|
| 337 | free(pmbInfo);
|
---|
| 338 | return rc;
|
---|
| 339 | }
|
---|
| 340 | return MBID_ERROR;
|
---|
| 341 | }
|
---|
| 342 | // ** AddSysMenuItem ****************************************************** /*FOLD00*/
|
---|
| 343 |
|
---|
[2] | 344 | VOID AddSysMenuItem (HWND hwndFrame, MENUITEM *Item, PSZ Text)
|
---|
| 345 | {
|
---|
| 346 | HWND hwndSysMenu = WinWindowFromID (hwndFrame, FID_SYSMENU);
|
---|
| 347 | USHORT idSysMenu = SHORT1FROMMR (WinSendMsg (hwndSysMenu,
|
---|
| 348 | MM_ITEMIDFROMPOSITION, NULL,
|
---|
| 349 | NULL ));
|
---|
| 350 | MENUITEM miSysMenu;
|
---|
| 351 | WinSendMsg (hwndSysMenu, MM_QUERYITEM,
|
---|
| 352 | MPFROM2SHORT (idSysMenu,FALSE), MPFROMP(&miSysMenu));
|
---|
| 353 |
|
---|
| 354 | HWND hwndSysSubMenu = miSysMenu.hwndSubMenu;
|
---|
| 355 |
|
---|
| 356 | WinSendMsg (hwndSysSubMenu, MM_INSERTITEM, MPFROMP(Item), MPFROMP(Text));
|
---|
| 357 | }
|
---|
| 358 |
|
---|
| 359 | // ** DoCountdown ********************************************************* /*fold00*/
|
---|
| 360 |
|
---|
| 361 | VOID DoCountdown (ULONG ul)
|
---|
| 362 | {
|
---|
| 363 | if (ul > 10)
|
---|
| 364 | DosBeep (4000L-3000L, 20);
|
---|
| 365 | else
|
---|
| 366 | DosBeep (4000L-ul*300L, 20);
|
---|
| 367 | }
|
---|
| 368 |
|
---|
| 369 | // ** SetIdlePriority **************************************************** /*FOLD00*/
|
---|
| 370 |
|
---|
| 371 | VOID SetIdlePriority (BOOL f)
|
---|
| 372 | {
|
---|
[52] | 373 | #ifndef _QUEIT_
|
---|
[2] | 374 | if (f)
|
---|
| 375 | DosSetPriority(PRTYS_PROCESS, PRTYC_IDLETIME, 0, 0);
|
---|
| 376 | else
|
---|
| 377 | DosSetPriority(PRTYS_PROCESS, PRTYC_REGULAR, 0, 0);
|
---|
[27] | 378 | #else
|
---|
| 379 | DosSetPriority(PRTYS_PROCESS, PRTYC_FOREGROUNDSERVER, 0, 0);
|
---|
| 380 | #endif
|
---|
[2] | 381 | }
|
---|
| 382 |
|
---|
| 383 | // ***********************************************************************
|
---|
| 384 |
|
---|
| 385 | #ifdef _DOLOGMEM_
|
---|
| 386 | VOID LogMem (PSZ psz, BOOL f)
|
---|
| 387 | {
|
---|
| 388 | FILE *pf = fopen("gotcha.mem","ab");
|
---|
| 389 | static ULONG TotalPhysicalMemory, ul = 0;
|
---|
| 390 | ULONG i;
|
---|
| 391 | if (!f)
|
---|
| 392 | ul--;
|
---|
| 393 | DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &TotalPhysicalMemory,
|
---|
| 394 | sizeof(TotalPhysicalMemory));
|
---|
| 395 | for (i = 0; i < ul; i++)
|
---|
| 396 | fputs(" ", pf);
|
---|
| 397 | fprintf(pf,"%10ld (%s)\n", TotalPhysicalMemory, psz);
|
---|
| 398 | if (f)
|
---|
| 399 | ul++;
|
---|
| 400 | fclose(pf);
|
---|
| 401 | }
|
---|
| 402 | #endif
|
---|
| 403 |
|
---|
| 404 | #ifdef _DOLOGDEBUG_
|
---|
| 405 | VOID LogDebug( PSZ psz, ... )
|
---|
| 406 | {
|
---|
| 407 | CHAR dstring[401];
|
---|
| 408 | va_list valst;
|
---|
| 409 |
|
---|
| 410 | va_start (valst, psz);
|
---|
| 411 | vsnprintf (dstring, 401, psz, valst);
|
---|
| 412 | va_end (valst);
|
---|
| 413 |
|
---|
| 414 | FILE *pf = fopen( "gotcha.log", "ab" );
|
---|
| 415 | fprintf( pf, "%s\n", dstring );
|
---|
| 416 | fclose( pf );
|
---|
| 417 | }
|
---|
| 418 | #endif
|
---|
| 419 |
|
---|
| 420 | // ***********************************************************************
|
---|