[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 |
|
---|
[89] | 116 | // Load settings move up here so the string table is available for the already running error
|
---|
| 117 | pset = new SETTINGS;
|
---|
[2] | 118 | //DisplayError("DEBUG", "%d", Version());
|
---|
[30] | 119 | #ifdef _QUIET_
|
---|
[50] | 120 | if ((Version() < 2))
|
---|
[2] | 121 | {
|
---|
[55] | 122 | DisplayError("GOTCHDLL.DLL Outdated",
|
---|
| 123 | "The file gotchdll.dll is is outdated. You should have "
|
---|
| 124 | "received a new version with the program, check for an "
|
---|
| 125 | "older version of gotchdll.dll in your LIBPATH. Is the "
|
---|
| 126 | "new gotchdll.dll in a directory in your LIBPATH?");
|
---|
[2] | 127 | exit (0);
|
---|
| 128 | }
|
---|
[27] | 129 | int rc;
|
---|
[50] | 130 | HMTX hmtx = NULLHANDLE;
|
---|
[89] | 131 | // running multiple instances orphans all but the first hook unloaded
|
---|
[50] | 132 | rc = DosOpenMutexSem("\\SEM32\\GOTCHA", &hmtx);
|
---|
| 133 | if (!rc) {
|
---|
[89] | 134 | DisplayError(RSTR (IDS_ERROR_ALREADYRUNNING),
|
---|
| 135 | RSTR (IDS_ERROR_ALREADYRUNNINGMSG));
|
---|
[50] | 136 | exit (0);
|
---|
[27] | 137 | }
|
---|
[50] | 138 | rc = DosCreateMutexSem("\\SEM32\\GOTCHA", &hmtx, 0, FALSE);
|
---|
| 139 | if (rc) {
|
---|
| 140 | DisplayError("Semaphore creation failed",
|
---|
| 141 | "Try restarting Gotcha Quiet");
|
---|
| 142 | exit (0);
|
---|
| 143 | }
|
---|
[30] | 144 | #endif
|
---|
[27] | 145 |
|
---|
[2] | 146 | // register our window classes
|
---|
| 147 | WinRegisterClass (hab, "thth.wc.gotcha.main", WindowProcedure, 0L,
|
---|
| 148 | sizeof (ULONG)*2L);
|
---|
[89] | 149 | #ifndef _QUIET_
|
---|
[2] | 150 | WinRegisterClass (hab, "thth.wc.gotcha.snapshot", wpSnapshot,
|
---|
| 151 | CS_SIZEREDRAW, sizeof (ULONG)*2L);
|
---|
[89] | 152 | #endif
|
---|
[2] | 153 | // load the settings
|
---|
[89] | 154 | //pset = new SETTINGS;
|
---|
[2] | 155 |
|
---|
[27] | 156 | pset->idleSetInIni = pset->QueryFlag(SEI_IDLEPRIORITY);
|
---|
| 157 | pset->saveStyle = pset->QuerySaveStyle ();
|
---|
| 158 | pset->pNumSaveDir = pset->QueryNumSaveDir ();
|
---|
| 159 | pset->pForceSaveFile = pset->QueryForceSaveFile();
|
---|
| 160 | pset->bSerialCapture = pset->SerialCapture ();
|
---|
[50] | 161 |
|
---|
[2] | 162 | // check cmd line args and if "-a" found take screenshot and exit
|
---|
| 163 | if (CheckCmdlineArgs (argc, argv))
|
---|
| 164 | {
|
---|
| 165 | CaptureWindow (HWND_DESKTOP, HWND_DESKTOP, NULL, TRUE);
|
---|
[27] | 166 | pset->SetFileSaveStyle(pset->saveStyle);
|
---|
[38] | 167 | pset->SetNumSaveDir (pset->pNumSaveDir);
|
---|
[2] | 168 | delete pset;
|
---|
| 169 | WinDestroyMsgQueue (hmq);
|
---|
| 170 | WinTerminate (hab);
|
---|
| 171 | exit (0);
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | SetIdlePriority(pset->QueryFlag(SEI_IDLEPRIORITY));
|
---|
| 175 |
|
---|
| 176 | // create the windows
|
---|
| 177 | hwndFrame = CreateMainWindow ();
|
---|
[89] | 178 | #ifndef _QUIET_
|
---|
[2] | 179 | hwndSnapshot = CreateSnapshotWindow ();
|
---|
[89] | 180 | #endif
|
---|
[2] | 181 | SWP swp;
|
---|
| 182 | USHORT us[7];
|
---|
| 183 |
|
---|
| 184 | // position main window
|
---|
| 185 | pset->QueryWindowData (&swp, us, FALSE);
|
---|
| 186 | WinSetWindowPos (hwndFrame, HWND_DESKTOP, swp.x,swp.y, 0,0,
|
---|
| 187 | SWP_SHOW | SWP_MOVE);
|
---|
| 188 |
|
---|
[38] | 189 |
|
---|
[30] | 190 | #ifdef _QUIET_
|
---|
[57] | 191 | bool fPrtScr = FALSE;
|
---|
| 192 | if (!g_usePMps) {
|
---|
| 193 | // always turn it off while running
|
---|
| 194 | // WinSet does not effect the ini setting
|
---|
| 195 | WinSetSysValue(HWND_DESKTOP, SV_PRINTSCREEN , fPrtScr);
|
---|
| 196 | }
|
---|
| 197 | InitDLL (hab, hwndFrame, g_usePMps);
|
---|
| 198 | StartInputHook ();
|
---|
[2] | 199 | #endif
|
---|
[89] | 200 | #ifndef _QUIET_
|
---|
[2] | 201 | // position snapshot window
|
---|
| 202 | pset->QueryWindowData (&swp, us);
|
---|
| 203 |
|
---|
| 204 | // size, activate & show window
|
---|
| 205 | WinSetWindowPos (hwndSnapshot, HWND_DESKTOP, swp.x,swp.y, swp.cx,swp.cy,
|
---|
| 206 | SWP_SHOW | SWP_SIZE | SWP_MOVE);
|
---|
| 207 | if (! pset->SnapshotWindow ())
|
---|
| 208 | WinShowWindow (hwndSnapshot, FALSE);
|
---|
| 209 | else
|
---|
| 210 | WinShowWindow (hwndSnapshot, TRUE);
|
---|
[89] | 211 | #endif
|
---|
[2] | 212 | WinSetWindowPos (hwndFrame, NULLHANDLE, 0,0, 0,0, SWP_SHOW);
|
---|
| 213 | WinSetWindowPos (WinWindowFromID (hwndFrame, FID_CLIENT), NULLHANDLE,
|
---|
| 214 | 0,0, 0,0, SWP_SHOW);
|
---|
| 215 |
|
---|
| 216 | g_phelp = new Helper(hwndFrame);
|
---|
| 217 |
|
---|
| 218 |
|
---|
| 219 | // do the main msg loop
|
---|
| 220 | QMSG qmsg;
|
---|
| 221 | while (WinGetMsg (hab, &qmsg, 0L, 0, 0))
|
---|
| 222 | WinDispatchMsg (hab, &qmsg);
|
---|
| 223 |
|
---|
[27] | 224 |
|
---|
| 225 | // Set priorty to unless user set regular since running -q sets it to idle in the ini
|
---|
[38] | 226 | if (g_fIdle) {
|
---|
[27] | 227 | pset->SetFlag (SEI_IDLEPRIORITY, pset->idleSetInIni);
|
---|
| 228 | }
|
---|
| 229 | // Don't change the ini stored paths if the paths were set from the command line
|
---|
| 230 | if (g_fSetPathName) {
|
---|
| 231 | pset->SetFileSaveStyle(pset->saveStyle);
|
---|
| 232 | pset->SetForceSaveFile (pset->pForceSaveFile);
|
---|
| 233 | pset->SetNumSaveDir (pset->pNumSaveDir);
|
---|
| 234 | }
|
---|
[89] | 235 | #ifndef _QUIET_
|
---|
[2] | 236 | // save size, etc. of snapshot window
|
---|
| 237 | WinQueryWindowPos (hwndSnapshot, &swp);
|
---|
| 238 | pset->SetWindowData (&swp);
|
---|
[89] | 239 | #endif
|
---|
[2] | 240 | // save size, etc. of main window
|
---|
| 241 | WinQueryWindowPos (hwndFrame, &swp);
|
---|
| 242 | pset->SetWindowData (&swp, FALSE);
|
---|
| 243 |
|
---|
| 244 | // goodbye windows!
|
---|
[89] | 245 | #ifndef _QUIET_
|
---|
[2] | 246 | WinDestroyWindow (hwndSnapshot);
|
---|
[89] | 247 | #endif
|
---|
[2] | 248 | WinDestroyWindow (hwndFrame);
|
---|
| 249 |
|
---|
[30] | 250 | #ifdef _QUIET_
|
---|
[52] | 251 | // Reset to user PM print screen choice
|
---|
[57] | 252 | if (!g_usePMps) {
|
---|
| 253 | ULONG ulDataSize = 0;
|
---|
| 254 | rc = PrfQueryProfileSize(HINI_USERPROFILE, "PM_ControlPanel",
|
---|
| 255 | "PrintScreen", &ulDataSize );
|
---|
| 256 | rc = PrfQueryProfileData(HINI_USERPROFILE, "PM_ControlPanel",
|
---|
| 257 | "PrintScreen", &fPrtScr, &ulDataSize);
|
---|
| 258 | if (!rc) // Print screen is on by default (no ini entry)
|
---|
| 259 | fPrtScr = TRUE;
|
---|
| 260 | WinSetSysValue(HWND_DESKTOP, SV_PRINTSCREEN , fPrtScr);
|
---|
| 261 | }
|
---|
[38] | 262 | StopInputHook ();
|
---|
[50] | 263 | DosCloseMutexSem(hmtx);
|
---|
[2] | 264 | #endif
|
---|
[50] | 265 |
|
---|
[2] | 266 | delete g_phelp;
|
---|
| 267 | delete pset;
|
---|
| 268 |
|
---|
| 269 | WinDestroyMsgQueue (hmq);
|
---|
| 270 | WinTerminate (hab);
|
---|
| 271 |
|
---|
| 272 | #ifdef _DOLOGMEM_
|
---|
| 273 | LogMem("main", FALSE);
|
---|
| 274 | #endif
|
---|
| 275 | #ifdef _DOLOGDEBUG_
|
---|
| 276 | LogDebug( "Gotcha! end" );
|
---|
| 277 | #endif
|
---|
| 278 | }
|
---|
| 279 |
|
---|
| 280 | // ** DisplayError ******************************************************** /*FOLD00*/
|
---|
| 281 |
|
---|
| 282 | VOID DisplayError (PSZ pszTitle, PSZ psz, ...)
|
---|
| 283 | {
|
---|
| 284 | CHAR dstring[401];
|
---|
| 285 | va_list valst;
|
---|
| 286 |
|
---|
| 287 | va_start (valst, psz);
|
---|
| 288 | vsnprintf (dstring, 401, psz, valst);
|
---|
| 289 | va_end (valst);
|
---|
| 290 |
|
---|
| 291 | WinMessageBox (HWND_DESKTOP, WinQueryActiveWindow (HWND_DESKTOP), dstring,
|
---|
| 292 | pszTitle, 0, MB_OK | MB_ERROR | MB_APPLMODAL | MB_MOVEABLE);
|
---|
| 293 | }
|
---|
| 294 |
|
---|
[38] | 295 | // saymsg2 was adapted from code in FM/2
|
---|
[27] | 296 | APIRET saymsg2(int DefaultButton, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...)
|
---|
| 297 | {
|
---|
| 298 | ULONG i;
|
---|
| 299 | APIRET rc;
|
---|
| 300 | CHAR szMsg[4096];
|
---|
| 301 | va_list va;
|
---|
| 302 | MB2INFO *pmbInfo;
|
---|
| 303 | MB2D mb2dBut[3];
|
---|
| 304 | ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * 2));
|
---|
[2] | 305 |
|
---|
[27] | 306 | va_start(va, pszFmt);
|
---|
| 307 | szMsg[sizeof(szMsg) - 1] = 0;
|
---|
| 308 | vsprintf(szMsg, pszFmt, va);
|
---|
| 309 | va_end(va);
|
---|
| 310 |
|
---|
| 311 | if (szMsg[sizeof(szMsg) - 1]) {
|
---|
| 312 | fprintf(stderr, "Buffer overflow in saymsg2 - need %u bytes\n", strlen(szMsg) + 1);
|
---|
| 313 | fflush(stderr);
|
---|
| 314 | }
|
---|
| 315 |
|
---|
[59] | 316 | memset(mb2dBut, 0, sizeof(MB2D) * 2);
|
---|
[55] | 317 | strcpy(mb2dBut[0].achText,RSTR(IDS_OK));
|
---|
| 318 | strcpy(mb2dBut[1].achText,RSTR(IDS_CANCEL));
|
---|
[59] | 319 | //strcpy(mb2dBut[2].achText,RSTR(IDS_SETTINGS));
|
---|
[27] | 320 | mb2dBut[0].idButton = 1;
|
---|
| 321 | mb2dBut[1].idButton = 2;
|
---|
[59] | 322 | //mb2dBut[2].idButton = 3;
|
---|
[27] | 323 | if (DefaultButton)
|
---|
| 324 | mb2dBut[DefaultButton - 1].flStyle = BS_DEFAULT;
|
---|
| 325 | pmbInfo = (MB2INFO *) malloc(ulInfoSize);
|
---|
| 326 | memset(pmbInfo, 0, ulInfoSize);
|
---|
| 327 | if (pmbInfo) {
|
---|
| 328 | pmbInfo->cb = ulInfoSize;
|
---|
| 329 | pmbInfo->hIcon = 0;
|
---|
[59] | 330 | pmbInfo->cButtons = 2;
|
---|
[27] | 331 | pmbInfo->flStyle = MB_MOVEABLE | MB_ICONQUESTION ;
|
---|
| 332 | pmbInfo->hwndNotify = NULLHANDLE;
|
---|
[59] | 333 | for (i = 0; i < 2; i++) {
|
---|
[27] | 334 | memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D));
|
---|
| 335 | }
|
---|
| 336 | rc = WinMessageBox2(HWND_DESKTOP, hwnd,
|
---|
| 337 | szMsg, pszTitle, SM2_DIALOG,
|
---|
| 338 | pmbInfo);
|
---|
| 339 | WinSetFocus(HWND_DESKTOP, SM2_DIALOG);
|
---|
| 340 | free(pmbInfo);
|
---|
| 341 | return rc;
|
---|
| 342 | }
|
---|
| 343 | return MBID_ERROR;
|
---|
| 344 | }
|
---|
| 345 | // ** AddSysMenuItem ****************************************************** /*FOLD00*/
|
---|
| 346 |
|
---|
[2] | 347 | VOID AddSysMenuItem (HWND hwndFrame, MENUITEM *Item, PSZ Text)
|
---|
| 348 | {
|
---|
| 349 | HWND hwndSysMenu = WinWindowFromID (hwndFrame, FID_SYSMENU);
|
---|
| 350 | USHORT idSysMenu = SHORT1FROMMR (WinSendMsg (hwndSysMenu,
|
---|
| 351 | MM_ITEMIDFROMPOSITION, NULL,
|
---|
| 352 | NULL ));
|
---|
| 353 | MENUITEM miSysMenu;
|
---|
| 354 | WinSendMsg (hwndSysMenu, MM_QUERYITEM,
|
---|
| 355 | MPFROM2SHORT (idSysMenu,FALSE), MPFROMP(&miSysMenu));
|
---|
| 356 |
|
---|
| 357 | HWND hwndSysSubMenu = miSysMenu.hwndSubMenu;
|
---|
| 358 |
|
---|
| 359 | WinSendMsg (hwndSysSubMenu, MM_INSERTITEM, MPFROMP(Item), MPFROMP(Text));
|
---|
| 360 | }
|
---|
| 361 |
|
---|
| 362 | // ** DoCountdown ********************************************************* /*fold00*/
|
---|
| 363 |
|
---|
| 364 | VOID DoCountdown (ULONG ul)
|
---|
| 365 | {
|
---|
| 366 | if (ul > 10)
|
---|
| 367 | DosBeep (4000L-3000L, 20);
|
---|
| 368 | else
|
---|
| 369 | DosBeep (4000L-ul*300L, 20);
|
---|
| 370 | }
|
---|
| 371 |
|
---|
| 372 | // ** SetIdlePriority **************************************************** /*FOLD00*/
|
---|
| 373 |
|
---|
| 374 | VOID SetIdlePriority (BOOL f)
|
---|
| 375 | {
|
---|
[52] | 376 | #ifndef _QUEIT_
|
---|
[2] | 377 | if (f)
|
---|
| 378 | DosSetPriority(PRTYS_PROCESS, PRTYC_IDLETIME, 0, 0);
|
---|
| 379 | else
|
---|
| 380 | DosSetPriority(PRTYS_PROCESS, PRTYC_REGULAR, 0, 0);
|
---|
[27] | 381 | #else
|
---|
| 382 | DosSetPriority(PRTYS_PROCESS, PRTYC_FOREGROUNDSERVER, 0, 0);
|
---|
| 383 | #endif
|
---|
[2] | 384 | }
|
---|
| 385 |
|
---|
| 386 | // ***********************************************************************
|
---|
| 387 |
|
---|
| 388 | #ifdef _DOLOGMEM_
|
---|
| 389 | VOID LogMem (PSZ psz, BOOL f)
|
---|
| 390 | {
|
---|
| 391 | FILE *pf = fopen("gotcha.mem","ab");
|
---|
| 392 | static ULONG TotalPhysicalMemory, ul = 0;
|
---|
| 393 | ULONG i;
|
---|
| 394 | if (!f)
|
---|
| 395 | ul--;
|
---|
| 396 | DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &TotalPhysicalMemory,
|
---|
| 397 | sizeof(TotalPhysicalMemory));
|
---|
| 398 | for (i = 0; i < ul; i++)
|
---|
| 399 | fputs(" ", pf);
|
---|
| 400 | fprintf(pf,"%10ld (%s)\n", TotalPhysicalMemory, psz);
|
---|
| 401 | if (f)
|
---|
| 402 | ul++;
|
---|
| 403 | fclose(pf);
|
---|
| 404 | }
|
---|
| 405 | #endif
|
---|
| 406 |
|
---|
| 407 | #ifdef _DOLOGDEBUG_
|
---|
| 408 | VOID LogDebug( PSZ psz, ... )
|
---|
| 409 | {
|
---|
| 410 | CHAR dstring[401];
|
---|
| 411 | va_list valst;
|
---|
| 412 |
|
---|
| 413 | va_start (valst, psz);
|
---|
| 414 | vsnprintf (dstring, 401, psz, valst);
|
---|
| 415 | va_end (valst);
|
---|
| 416 |
|
---|
| 417 | FILE *pf = fopen( "gotcha.log", "ab" );
|
---|
| 418 | fprintf( pf, "%s\n", dstring );
|
---|
| 419 | fclose( pf );
|
---|
| 420 | }
|
---|
| 421 | #endif
|
---|
| 422 |
|
---|
| 423 | // ***********************************************************************
|
---|