ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Windows/util_windows.cpp
(Generate patch)

Comparing BasiliskII/src/Windows/util_windows.cpp (file contents):
Revision 1.1 by gbeauche, 2004-12-03T22:01:47Z vs.
Revision 1.4 by gbeauche, 2005-03-19T19:01:49Z

# Line 1 | Line 1
1   /*
2   *  util_windows.cpp - Miscellaneous utilities for Win32
3   *
4 < *  Basilisk II (C) 1997-2004 Christian Bauer
4 > *  Basilisk II (C) 1997-2005 Christian Bauer
5   *
6   *  Windows platform specific code copyright (C) Lauri Pesonen
7   *
# Line 22 | Line 22
22  
23   #include "sysdeps.h"
24   #include "util_windows.h"
25 + #include "main.h"
26  
27   BOOL exists( const char *path )
28   {
# Line 83 | Line 84 | int32 get_file_size( const char *path )
84          }
85          return(size);
86   }
87 +
88 +
89 + /*
90 + *  Thread wrappers
91 + */
92 +
93 + HANDLE create_thread(LPTHREAD_START_ROUTINE start_routine, void *arg)
94 + {
95 +        DWORD dwThreadId;
96 +        return CreateThread(NULL, 0, start_routine, arg, 0, &dwThreadId);
97 + }
98 +
99 + void wait_thread(HANDLE thread)
100 + {
101 +        WaitForSingleObject(thread, INFINITE);
102 +        CloseHandle(thread);
103 + }
104 +
105 + void kill_thread(HANDLE thread)
106 + {
107 +        TerminateThread(thread, 0);
108 + }
109 +
110 +
111 + /*
112 + *  Check that drivers are installed
113 + */
114 +
115 + bool check_drivers(void)
116 + {
117 +        char path[_MAX_PATH];
118 +        GetSystemDirectory(path, sizeof(path));
119 +        strcat(path, "\\drivers\\cdenable.sys");
120 +
121 +        if (exists(path)) {
122 +                int32 size = get_file_size(path);
123 +                if (size != 6112) {
124 +                        char str[256];
125 +                        sprintf(str, "The CD-ROM driver file \"%s\" is too old or corrupted.", path);
126 +                        ErrorAlert(str);
127 +                        return false;
128 +                }
129 +        }
130 +        else {
131 +                char str[256];
132 +                sprintf(str, "The CD-ROM driver file \"%s\" is missing.", path);
133 +                WarningAlert(str);
134 +        }
135 +
136 +        return true;
137 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines