]> git.sesse.net Git - vlc/blobdiff - src/misc/win32_specific.c
vlc_app: Forgotten resources files.
[vlc] / src / misc / win32_specific.c
index 621a47b30b80cac5ad47332bf0ac7bd2e48782d3..137ac397db21ad315f1da71d872b05737959aebf 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include "../libvlc.h"
 #include <vlc_playlist.h>
@@ -41,7 +45,7 @@
 /*****************************************************************************
  * system_Init: initialize winsock and misc other things.
  *****************************************************************************/
-void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
+void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
 {
     WSADATA Data;
 
@@ -135,7 +139,7 @@ typedef struct
   char data[0];
 } vlc_ipc_data_t;
 
-void system_Configure( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
+void system_Configure( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
 {
 #if !defined( UNDER_CE )
     /* Raise default priority of the current process */
@@ -218,7 +222,7 @@ void system_Configure( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
                 COPYDATASTRUCT wm_data;
                 int i_opt;
                 vlc_ipc_data_t *p_data;
-                size_t i_data = sizeof (p_data);
+                size_t i_data = sizeof (*p_data);
 
                 for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
                 {
@@ -237,9 +241,10 @@ void system_Configure( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
                      * with stronger alignment requirements, right. */
                     *((size_t *)(p_data->data + i_data)) = i_len;
                     i_data += sizeof (size_t);
-                    memcpy( &p_data[i_data], ppsz_argv[ i_opt ], i_len );
+                    memcpy( &p_data->data[i_data], ppsz_argv[ i_opt ], i_len );
                     i_data += i_len;
                 }
+                i_data += sizeof (*p_data);
 
                 /* Send our playlist items to the 1st instance */
                 wm_data.dwData = 0;
@@ -321,9 +326,8 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
             ppsz_argv = (char **)malloc( i_argc * sizeof(char *) );
             for( i_opt = 0; i_opt < i_argc; i_opt++ )
             {
-                ppsz_argv[i_opt] = &p_data[i_data + sizeof(int)];
-                i_data += *((int *)&p_data[i_data]);
-                i_data += sizeof(int);
+                ppsz_argv[i_opt] = p_data->data + i_data + sizeof(int);
+                i_data += sizeof(int) + *((int *)(p_data->data + i_data));
             }
 
             for( i_opt = 0; i_opt < i_argc; i_opt++ )
@@ -368,3 +372,12 @@ void system_End( libvlc_int_t *p_this )
 
     WSACleanup();
 }
+
+/*****************************************************************************
+ *  system_VLCPath
+ *  **************************************************************************/
+const char* system_VLCPath( void )
+{
+    libvlc_global_data_t* libvlc_global = vlc_global();
+    return libvlc_global->psz_vlcpath;
+}