Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5a9c88d6
Commit
5a9c88d6
authored
Dec 07, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecrt0: Create the Ansi argv from the Unicode one.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ff91d947
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
5 deletions
+29
-5
dll_entry.c
dlls/winecrt0/dll_entry.c
+1
-1
drv_entry.c
dlls/winecrt0/drv_entry.c
+1
-1
exe_entry.c
dlls/winecrt0/exe_entry.c
+26
-2
exe_wentry.c
dlls/winecrt0/exe_wentry.c
+1
-1
No files found.
dlls/winecrt0/dll_entry.c
View file @
5a9c88d6
...
...
@@ -38,7 +38,7 @@ BOOL WINAPI DECLSPEC_HIDDEN __wine_spec_dll_entry( HINSTANCE inst, DWORD reason,
if
(
reason
==
DLL_PROCESS_ATTACH
&&
__wine_spec_init_state
!=
CONSTRUCTORS_DONE
)
{
call_fini
=
TRUE
;
_init
(
__wine_main_argc
,
__wine_main_argv
,
NULL
);
_init
(
0
,
NULL
,
NULL
);
}
ret
=
DllMain
(
inst
,
reason
,
reserved
);
...
...
dlls/winecrt0/drv_entry.c
View file @
5a9c88d6
...
...
@@ -35,7 +35,7 @@ NTSTATUS DECLSPEC_HIDDEN WINAPI __wine_spec_drv_entry( struct _DRIVER_OBJECT *ob
{
BOOL
needs_init
=
(
__wine_spec_init_state
!=
CONSTRUCTORS_DONE
);
if
(
needs_init
)
_init
(
__wine_main_argc
,
__wine_main_argv
,
NULL
);
if
(
needs_init
)
_init
(
0
,
NULL
,
NULL
);
return
DriverEntry
(
obj
,
path
);
/* there is no detach routine so we can't call destructors */
}
dlls/winecrt0/exe_entry.c
View file @
5a9c88d6
...
...
@@ -25,19 +25,43 @@
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winternl.h"
#include "wine/library.h"
#include "crt0_private.h"
extern
int
__cdecl
main
(
int
argc
,
char
*
argv
[]
);
static
char
**
build_argv
(
WCHAR
**
wargv
)
{
int
argc
;
char
*
p
,
**
argv
;
DWORD
total
=
0
;
for
(
argc
=
0
;
wargv
[
argc
];
argc
++
)
total
+=
WideCharToMultiByte
(
CP_ACP
,
0
,
wargv
[
argc
],
-
1
,
NULL
,
0
,
NULL
,
NULL
);
argv
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
+
(
argc
+
1
)
*
sizeof
(
*
argv
)
);
p
=
(
char
*
)(
argv
+
argc
+
1
);
for
(
argc
=
0
;
wargv
[
argc
];
argc
++
)
{
DWORD
reslen
=
WideCharToMultiByte
(
CP_ACP
,
0
,
wargv
[
argc
],
-
1
,
p
,
total
,
NULL
,
NULL
);
argv
[
argc
]
=
p
;
p
+=
reslen
;
total
-=
reslen
;
}
argv
[
argc
]
=
NULL
;
return
argv
;
}
DWORD
WINAPI
DECLSPEC_HIDDEN
__wine_spec_exe_entry
(
PEB
*
peb
)
{
BOOL
needs_init
=
(
__wine_spec_init_state
!=
CONSTRUCTORS_DONE
);
char
**
argv
=
build_argv
(
__wine_main_wargv
);
DWORD
ret
;
if
(
needs_init
)
_init
(
__wine_main_argc
,
__wine_main_
argv
,
NULL
);
ret
=
main
(
__wine_main_argc
,
__wine_main_
argv
);
if
(
needs_init
)
_init
(
__wine_main_argc
,
argv
,
NULL
);
ret
=
main
(
__wine_main_argc
,
argv
);
if
(
needs_init
)
_fini
();
ExitProcess
(
ret
);
}
dlls/winecrt0/exe_wentry.c
View file @
5a9c88d6
...
...
@@ -36,7 +36,7 @@ DWORD WINAPI DECLSPEC_HIDDEN __wine_spec_exe_wentry( PEB *peb )
BOOL
needs_init
=
(
__wine_spec_init_state
!=
CONSTRUCTORS_DONE
);
DWORD
ret
;
if
(
needs_init
)
_init
(
__wine_main_argc
,
__wine_main_argv
,
NULL
);
if
(
needs_init
)
_init
(
0
,
NULL
,
NULL
);
ret
=
wmain
(
__wine_main_argc
,
__wine_main_wargv
);
if
(
needs_init
)
_fini
();
ExitProcess
(
ret
);
...
...
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