SafeDisc-1

Laurent Pinchart laurent.pinchart at skynet.be
Sun Apr 28 17:16:13 CDT 2002


Here's (at last) the (long awaited ?) SafeDisc patch.

I want to thank Zsolt Rizsanyi who helped me with the CDROM ioctls (his 
implementation of IOCTL_SCSI_GET_ADDRESS has not been included in this patch, 
as I don't have the latest version), Alexandre Juliard for his help with the 
process suspension, Erich Pouech and Andreas Mohr for their help about how to 
handle the reentrant wine server calls (even if that has turned out not to be 
needed in the end), and all of those who answered my numerous questions on 
#winehq. To the ones I forgot (if any), please forgive me. If you help me 
with SafeDisc-1 I'll thank you twice :-)

As I don't speak 'legalese', here's the usual disclaimer in nglish:

This patch works on my system, and it will probably work for some of you. For 
those who can't get it to work, I'm really sorry, and I'll help if you ask 
nicely, but don't blame me or sue me.

Ok, on a more serious note, I split the patch into two files.

safedisc-safe.diff contains the code which doesn't infringe the DMCA (fixes 
and additions to wine).

        * dlls/ntdll/cdrom.c:
        Implementation of IOCTL_SCSI_PASS_THROUGH and
        IOCTL_SCSI_PASS_THROUGH_DIRECT.

        * dlls/ntdll/nt.c:
        Fixed NtQueryInformationProcess to return correct information and
        error code for ProcessDebugPort when no debugger is attached.

        * dlls/ntdll/signal_i386.c:
        Modified do_sigsegv to allow INSTR_EmulateInstruction to modify the
        exception code.

        * include/miscemu.h, memory/instr.c:
        Modified INSTR_EmulateInstruction so that int 0x01 emulation raises an
        EXCEPTION_ACCESS_VIOLATION instead of EXCEPTION_PRIV_INSTRUCTION.

        * include/wine/server_protocol.h, server/protocol.def, server/trace.c:
        Added a 'suspended' field to the init_process_done_reply structure.

        * memory/Makefile, memory/emulate.c:
        Preliminary implementation of the SharedUserData shared memory page,
        located at 0x7ffe0000.

        * scheduler/process.c:
        Reserves the SharedUserData page (PAGE_NOACCESS at 0x7ffe0000) at
        process initialization.
        Moved process suspension from the server to the client in
        start_process to avoid server call interruptions.

        * server/process.c, server/process.h, server/ptrace.c:
        Moved process suspension from the server to the client in
        start_process to avoid server call interruptions. This involves
        catching SIGSTOP in client processes to release the init_event.

safedisc-dmca.diff contains the code which *might* infringe the DMCA. In my 
opinion it doesn't, but I'm not a lawyer.

        * win32/device.c, win32/secdrv.c, include/secdrv.h:
        Implementation of the SafeDisc secdrv.sys NT driver.

This code has been written for what I call the 1.3.0 version of SafeDisc. I 
don't know how C-Dilla numbers the SafeDisc versions, but 1.3.0 is the 
version number used in communications between the SafeDisc main executable 
and secdrv.sys. The code might work for other versions, but might not. It 
will probably not work for SafeDisc-2 protected programs.

If you experience problems (crashes) when starting SafeDisc protected 
executables, I'd be very interested to hear about your problems, especially 
for SafeDisc-1 protected programs (SafeDisc-1 has a .ICD file on the CD).

Hope this will help someone.

Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: safedisc-dmca.diff
Type: text/x-c
Size: 9863 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20020429/88673d9b/safedisc-dmca.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: safedisc-safe.diff
Type: text/x-c
Size: 24190 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20020429/88673d9b/safedisc-safe.bin


More information about the wine-patches mailing list