shithub: libdvdcss

Download patch

ref: 92cc4b7d1617d548a4a79895cfeccba10dcae92b
parent: 1b06ce6cd351254c569c7718bce917f5e36767ac
author: Håkan Hjort <[email protected]>
date: Sun Feb 3 09:54:53 EST 2002

Add the WIN32 fix to GetTitleKey from the vlc/extra branch.


--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -2,7 +2,7 @@
  * ioctl.c: DVD ioctl replacement function
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ioctl.c,v 1.1 2001/12/22 00:08:13 sam Exp $
+ * $Id: ioctl.c,v 1.2 2002/02/03 14:54:53 hjort Exp $
  *
  * Authors: Markus Kuespert <[email protected]>
  *          Samuel Hocevar <[email protected]>
@@ -528,12 +528,11 @@
 
         memset( &buffer, 0, sizeof( buffer ) );
 
-        key->KeyLength  = DVD_BUS_KEY_LENGTH;
+        key->KeyLength  = DVD_TITLE_KEY_LENGTH;
         key->SessionId  = *pi_agid;
         key->KeyType    = DvdTitleKey;
         key->KeyFlags   = 0;
-#warning "Fix ReadTitleKey for WIN32!"
-        //key->Parameters.TitleOffset = i_pos; // is this ok?
+        key->Parameters.TitleOffset.QuadPart = (LONGLONG) i_pos;
 
         i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
                 key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
--- 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.1 2001/12/22 00:08:13 sam Exp $
+ * $Id: ioctl.h,v 1.2 2002/02/03 14:54:53 hjort Exp $
  *
  * Authors: Samuel Hocevar <[email protected]>
  *
@@ -158,6 +158,7 @@
 
 #define DVD_CHALLENGE_KEY_LENGTH        (12 + sizeof(DVD_COPY_PROTECT_KEY))
 #define DVD_BUS_KEY_LENGTH              (8 + sizeof(DVD_COPY_PROTECT_KEY))
+#define DVD_TITLE_KEY_LENGTH            (8 + sizeof(DVD_COPY_PROTECT_KEY))
 #define DVD_DISK_KEY_LENGTH             (2048 + sizeof(DVD_COPY_PROTECT_KEY))
 #define DVD_ASF_LENGTH                  (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))