Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
ee576c64
Commit
ee576c64
authored
Nov 04, 2006
by
Marian Durkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Win32 one-instance mode to accept non-ANSI CP characters
Closes #688
parent
0d85325d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
14 deletions
+45
-14
src/misc/win32_specific.c
src/misc/win32_specific.c
+45
-14
No files found.
src/misc/win32_specific.c
View file @
ee576c64
...
...
@@ -39,6 +39,9 @@
#include <winsock.h>
extern
void
__wgetmainargs
(
int
*
argc
,
wchar_t
***
wargv
,
wchar_t
***
wenviron
,
int
expand_wildcards
,
int
*
startupinfo
);
/*****************************************************************************
* system_Init: initialize winsock and misc other things.
*****************************************************************************/
...
...
@@ -203,26 +206,54 @@ void system_Configure( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
COPYDATASTRUCT
wm_data
;
int
i_opt
,
i_data
;
char
*
p_data
;
wchar_t
**
wargv
,
**
wenvp
;
int
si
=
{
0
};
i_data
=
sizeof
(
int
);
for
(
i_opt
=
optind
;
i_opt
<
*
pi_argc
;
i_opt
++
)
if
(
GetVersion
()
<
0x80000000
)
{
i_data
+=
sizeof
(
int
);
i_data
+=
strlen
(
ppsz_argv
[
i_opt
]
)
+
1
;
}
/* use unicode argv[] for Windows NT and above */
__wgetmainargs
(
&
i_opt
,
&
wargv
,
&
wenvp
,
0
,
&
si
);
for
(
i_opt
=
optind
;
i_opt
<
*
pi_argc
;
i_opt
++
)
{
i_data
+=
sizeof
(
int
);
i_data
+=
WideCharToMultiByte
(
CP_UTF8
,
0
,
wargv
[
i_opt
],
-
1
,
NULL
,
0
,
NULL
,
NULL
)
+
1
;
}
p_data
=
(
char
*
)
malloc
(
i_data
);
*
((
int
*
)
&
p_data
[
0
])
=
*
pi_argc
-
optind
;
i_data
=
sizeof
(
int
);
for
(
i_opt
=
optind
;
i_opt
<
*
pi_argc
;
i_opt
++
)
{
int
i_len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
wargv
[
i_opt
],
-
1
,
NULL
,
0
,
NULL
,
NULL
)
+
1
;
*
((
int
*
)
&
p_data
[
i_data
])
=
i_len
;
i_data
+=
sizeof
(
int
);
WideCharToMultiByte
(
CP_UTF8
,
0
,
wargv
[
i_opt
],
-
1
,
&
p_data
[
i_data
],
i_len
,
NULL
,
NULL
);
i_data
+=
i_len
;
}
p_data
=
(
char
*
)
malloc
(
i_data
);
*
((
int
*
)
&
p_data
[
0
])
=
*
pi_argc
-
optind
;
i_data
=
sizeof
(
int
);
for
(
i_opt
=
optind
;
i_opt
<
*
pi_argc
;
i_opt
++
)
}
else
{
int
i_len
=
strlen
(
ppsz_argv
[
i_opt
]
)
+
1
;
*
((
int
*
)
&
p_data
[
i_data
])
=
i_len
;
i_data
+=
sizeof
(
int
);
memcpy
(
&
p_data
[
i_data
],
ppsz_argv
[
i_opt
],
i_len
);
i_data
+=
i_len
;
for
(
i_opt
=
optind
;
i_opt
<
*
pi_argc
;
i_opt
++
)
{
i_data
+=
sizeof
(
int
);
i_data
+=
strlen
(
ppsz_argv
[
i_opt
]
)
+
1
;
}
p_data
=
(
char
*
)
malloc
(
i_data
);
*
((
int
*
)
&
p_data
[
0
])
=
*
pi_argc
-
optind
;
i_data
=
sizeof
(
int
);
for
(
i_opt
=
optind
;
i_opt
<
*
pi_argc
;
i_opt
++
)
{
int
i_len
=
strlen
(
ppsz_argv
[
i_opt
]
)
+
1
;
*
((
int
*
)
&
p_data
[
i_data
])
=
i_len
;
i_data
+=
sizeof
(
int
);
memcpy
(
&
p_data
[
i_data
],
ppsz_argv
[
i_opt
],
i_len
);
i_data
+=
i_len
;
}
}
/* Send our playlist items to the 1st instance */
wm_data
.
dwData
=
0
;
wm_data
.
cbData
=
i_data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment