Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

install/i_opencbm.c

Go to the documentation of this file.
00001 /*
00002  *      This program is free software; you can redistribute it and/or
00003  *      modify it under the terms of the GNU General Public License
00004  *      as published by the Free Software Foundation; either version
00005  *      2 of the License, or (at your option) any later version.
00006  *
00007  *  Copyright 2001-2004 Spiro Trikaliotis
00008  *
00009 */
00010 
00021 #ifndef DBG_PROGNAME
00022     #define DBG_PROGNAME "INSTCBM.EXE"
00023 #endif // #ifndef DBG_PROGNAME
00024 
00026 // #define DBG_USERMODE
00027 
00028 // Include the functionality of the DLL into the install
00029 // Application
00030 
00031 #include "../lib/WINBUILD/i_opencbm.c"
00032 
00033 
00046 VOID
00047 CbmInstallUpdate(VOID)
00048 {
00049     CBM_FILE HandleDevice;
00050 
00051     FUNC_ENTER();
00052 
00053     if (cbmarch_driver_open(&HandleDevice, 0) == 0)
00054     {
00055         cbm_ioctl(HandleDevice, CBMCTRL(UPDATE), NULL, 0, NULL, 0);
00056         cbmarch_driver_close(HandleDevice);
00057     }
00058 
00059     FUNC_LEAVE();
00060 }
00061 
00062 #if DBG
00063 
00064 #include <stdio.h>
00065 
00074 VOID
00075 CbmOutputDebuggingBuffer(VOID)
00076 {
00077 #define OUTPUT_BUFFER_LEN 0x20000
00078     CHAR *buffer;
00079 
00080     CBM_FILE HandleDevice;
00081 
00082     FUNC_ENTER();
00083 
00084     buffer = malloc(OUTPUT_BUFFER_LEN);
00085 
00086     if (buffer && cbmarch_driver_open(&HandleDevice, 0) == 0)
00087     {
00088         PCHAR p = buffer;
00089         PCHAR endLine;
00090 
00091         cbm_ioctl(HandleDevice, CBMCTRL(I_READDBG), NULL, 0, buffer, OUTPUT_BUFFER_LEN);
00092         cbmarch_driver_close(HandleDevice);
00093 
00094         printf("Output of the debugging buffer:\n\n");
00095 
00096         do {
00097 
00098             endLine = strchr(p, 13);
00099             if (endLine)
00100             {
00101                 *endLine = 0;
00102             }
00103             printf("%s", p);
00104 
00105             p = endLine + 1;
00106 
00107         } while (endLine);
00108     }
00109 
00110     if (buffer)
00111     {
00112         free(buffer);
00113     }
00114 
00115     FUNC_LEAVE();
00116 }
00117 
00118 #endif // #if DBG

Generated on Sun Apr 30 18:45:52 2006 for opencbm by  doxygen 1.4.2