Here is last instalment of safedisc support in Wine.
The major change from last version is the way user space talks to ntoskrnl. Now I'm passing the information through wineserver with a help of 4 server calls.
There are still some areas that require work.
I will appreciate any input that you guys might have about any part of this code. It's been on my lap for way too long. It would be really cool to finally get it in.
PS: Diffed against 1d40bf0141b7f67b1188555962698f5dab631bc3. Need to run tools/make_reqwests.
Vitaliy Margolen wrote:
Here is last instalment of safedisc support in Wine.
Great Stuff, but heavy.
Need to check with http://www.gameburnworld.com/PCprotectedgames.htm which CD I can use for testing.
Need to run tools/make_reqwests.
Big fingers at the Keyboard :-)
Just some things, that I want to mention without deep knowledge, what the code does:
+++ b/dlls/advapi32/service.c @@ -1569,6 +1625,40 @@ BOOL WINAPI QueryServiceStatus(SC_HANDLE
+ static int i; + + lpservicestatus->dwServiceType = SERVICE_KERNEL_DRIVER; + if (i == 0)
i was not initialized. You initialized static variables in other locations (static BOOL * = FALSE)
+ lpservicestatus->dwCurrentState = SERVICE_STOPPED; + else + { + Sleep(1000); + lpservicestatus->dwCurrentState = SERVICE_RUNNING;
Waiting for something, reason unknown without a comment. It seems to be related to: + * Note: NtQuerySystemInformation needs to be fixed to handle this
+++ b/dlls/ntdll/misc.c in NTSTATUS NTOSKRNL_connect(HANDLE *device_handle)
+ ntoskrnl_started = TRUE; + sleep(3); + continue; Waiting for something, reason unknown without a comment. Is it here to force a shedule / taskswitch?
+++ b/programs/ntoskrnl/ntoskrnl.c in static NTSTATUS driver_control(void)
+ /* Call DispatchDeviceContorl and return */ Typo: DispatchDeviceControl
+++ b/programs/ntoskrnl/ntoskrnl_api.c + * ExLocalTimeToSystemTime [NTDLL.@] Copy & Paste - Typo: [NTOSKRNL.@]
+++ b/programs/ntoskrnl/ntoskrnl_api.c +LPCSTR wine_dbgstr_us( const UNICODE_STRING *us )
This is also in "dlls/ntdll/misc.c" Is it useful to add "debugstr_us" to "include/wine/debug.h"?
+++ b/server/device.c + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This old Address slipped through
+++ b/server/object.h @@ -45,6 +45,7 @@ struct async; +struct semaphor;
Did you mean "struct semaphore;" here?
Tuesday, June 13, 2006, 4:27:07 PM, Detlef Riekenberg wrote:
Vitaliy Margolen wrote:
Here is last instalment of safedisc support in Wine.
Great Stuff, but heavy.
Thank you. I appreciate all the comments. Well it's not that easy to run kernel drivers...
lpservicestatus->dwCurrentState = SERVICE_STOPPED;
else
{
Sleep(1000);
lpservicestatus->dwCurrentState = SERVICE_RUNNING;
Waiting for something, reason unknown without a comment. It seems to be related to:
* Note: NtQuerySystemInformation needs to be fixed to handle this
+++ b/dlls/ntdll/misc.c in NTSTATUS NTOSKRNL_connect(HANDLE *device_handle)
ntoskrnl_started = TRUE;
sleep(3);
continue;
Waiting for something, reason unknown without a comment. Is it here to force a shedule / taskswitch?
Those are the two places that do need extra work. I'm not sure what would be a clean way to check if a driver is running (1st wait) and synch with child process startup - ntoskrnl (2nd wait).
+++ b/programs/ntoskrnl/ntoskrnl_api.c +LPCSTR wine_dbgstr_us( const UNICODE_STRING *us )
This is also in "dlls/ntdll/misc.c" Is it useful to add "debugstr_us" to "include/wine/debug.h"?
Yes that's where it came from. I'm not sure if it would be beneficial to move it or not.
Vitaliy.