shithub: libdvdcss

Download patch

ref: 30c2da59e16b6acc6afb42549b6dc799aad1b94a
parent: 550db7cd68db23d12a21ce1512a692e9a7e7c882
author: Sam Hocevar <sam@videolan.org>
date: Mon Jul 11 07:32:33 EDT 2005

* src/device.c src/ioctl.h: cosmetic fix that uses real Win32 types for
    dynamically loaded functions and gets rid of lvalue casts.


--- a/src/device.c
+++ b/src/device.c
@@ -2,7 +2,7 @@
  * device.h: DVD device access
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: device.c,v 1.19 2003/12/11 15:12:42 sam Exp $
+ * $Id$
  *
  * Authors: St�phane Borel <stef@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -280,7 +280,7 @@
      * won't send back the right result).
      * (See Microsoft Q241374: Read and Write Access Required for SCSI
      * Pass Through Requests) */
-    (HANDLE) dvdcss->i_fd =
+    dvdcss->i_fd = (int)
                 CreateFile( psz_dvd, GENERIC_READ | GENERIC_WRITE,
                             FILE_SHARE_READ | FILE_SHARE_WRITE,
                             NULL, OPEN_EXISTING,
@@ -287,7 +287,7 @@
                             FILE_FLAG_RANDOM_ACCESS, NULL );
 
     if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )
-        (HANDLE) dvdcss->i_fd =
+        dvdcss->i_fd = (int)
                     CreateFile( psz_dvd, GENERIC_READ, FILE_SHARE_READ,
                                 NULL, OPEN_EXISTING,
                                 FILE_FLAG_RANDOM_ACCESS, NULL );
@@ -309,8 +309,8 @@
     DWORD dwSupportInfo;
     struct w32_aspidev *fd;
     int i, j, i_hostadapters;
-    long (*lpGetSupport)( void );
-    long (*lpSendCommand)( void* );
+    GETASPI32SUPPORTINFO lpGetSupport;
+    SENDASPI32COMMAND lpSendCommand;
     char c_drive = psz_device[0];
 
     /* load aspi and init w32_aspidev structure */
@@ -321,8 +321,8 @@
         return -1;
     }
 
-    (FARPROC) lpGetSupport = GetProcAddress( hASPI, "GetASPI32SupportInfo" );
-    (FARPROC) lpSendCommand = GetProcAddress( hASPI, "SendASPI32Command" );
+    lpGetSupport = (GETASPI32SUPPORTINFO) GetProcAddress( hASPI, "GetASPI32SupportInfo" );
+    lpSendCommand = (SENDASPI32COMMAND) GetProcAddress( hASPI, "SendASPI32Command" );
 
     if(lpGetSupport == NULL || lpSendCommand == NULL )
     {
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -2,7 +2,7 @@
  * ioctl.h: DVD ioctl replacement function
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ioctl.h,v 1.14 2003/01/16 22:58:29 sam Exp $
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -318,6 +318,9 @@
  * win32 aspi specific
  *****************************************************************************/
 
+typedef WINAPI DWORD (*GETASPI32SUPPORTINFO)(VOID);
+typedef WINAPI DWORD (*SENDASPI32COMMAND)(LPVOID);
+
 #define WIN2K               ( GetVersion() < 0x80000000 )
 #define ASPI_HAID           0
 #define ASPI_TARGET         0
@@ -339,7 +342,7 @@
     long  hASPI;
     short i_sid;
     int   i_blocks;
-    long  (*lpSendCommand)( void* );
+    SENDASPI32COMMAND lpSendCommand;
 };
 
 #pragma pack(1)