]> git.sesse.net Git - vlc/blobdiff - modules/demux/mp4/drms.c
* modules/control/hotkeys.c, rc, modules/demux/mp4, modules/access/mms: portability...
[vlc] / modules / demux / mp4 / drms.c
index 7a69cdb7e115111987b2b81f2aa30e35da207dd8..784c633d18991989b9f1a9cf0257d2b019f13753 100644 (file)
@@ -42,6 +42,9 @@
 #endif
 
 #ifdef WIN32
+#   if !defined( UNDER_CE )
+#       include <direct.h>
+#   endif
 #   include <tchar.h>
 #   include <shlobj.h>
 #   include <windows.h>
@@ -1948,20 +1951,30 @@ static int GetiPodID( int64_t *p_ipod_id )
     mach_port_t port;
     io_object_t device;
     io_iterator_t iterator;
-    CFMutableDictionaryRef matching_dic;
+    CFMutableDictionaryRef match_dic;
+    CFMutableDictionaryRef smatch_dic;
 
     if( IOMasterPort( MACH_PORT_NULL, &port ) == KERN_SUCCESS )
     {
-        if( ( matching_dic = IOServiceMatching( "IOFireWireUnit" ) ) != NULL )
+        smatch_dic = IOServiceMatching( "IOFireWireUnit" );
+        match_dic = CFDictionaryCreateMutable( kCFAllocatorDefault, 0,
+                                           &kCFTypeDictionaryKeyCallBacks,
+                                           &kCFTypeDictionaryValueCallBacks );
+
+        if( smatch_dic != NULL && match_dic != NULL )
         {
-            CFDictionarySetValue( matching_dic,
+            CFDictionarySetValue( smatch_dic,
                                   CFSTR("FireWire Vendor Name"),
                                   CFSTR(VENDOR_NAME) );
-            CFDictionarySetValue( matching_dic,
+            CFDictionarySetValue( smatch_dic,
                                   CFSTR("FireWire Product Name"),
                                   CFSTR(PROD_NAME) );
 
-            if( IOServiceGetMatchingServices( port, matching_dic,
+            CFDictionarySetValue( match_dic,
+                                  CFSTR(kIOPropertyMatchKey),
+                                  smatch_dic );
+
+            if( IOServiceGetMatchingServices( port, match_dic,
                                               &iterator ) == KERN_SUCCESS )
             {
                 while( ( device = IOIteratorNext( iterator ) ) != NULL )