Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
30a3d18a
Commit
30a3d18a
authored
May 31, 2001
by
Francois Gouget
Committed by
Alexandre Julliard
May 31, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call FreeEnvironmentStrings when msvcrt is unloaded.
parent
a08b1659
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
data.c
dlls/msvcrt/data.c
+15
-10
No files found.
dlls/msvcrt/data.c
View file @
30a3d18a
...
...
@@ -42,6 +42,9 @@ WCHAR **MSVCRT___winitenv;
int
MSVCRT_timezone
;
int
MSVCRT_app_type
;
static
char
*
environ_strings
;
static
WCHAR
*
wenviron_strings
;
typedef
void
(
*
_INITTERMFUN
)(
void
);
/***********************************************************************
...
...
@@ -136,14 +139,14 @@ static WCHAR *wstrdupa(const char *str)
}
/* INTERNAL: Since we can't rely on Winelib startup code calling w/getmainargs,
* we initialise data values during DLL loading.
The w
hen called by a native
* we initialise data values during DLL loading.
W
hen called by a native
* program we simply return the data we've already initialised. This also means
* you can call multiple times without leaking
*/
void
msvcrt_init_args
(
void
)
{
char
*
cmdline
,
**
xargv
=
NULL
,
*
ptr
,
*
env
;
WCHAR
*
wcmdline
,
**
wxargv
=
NULL
,
*
wptr
,
*
wenv
;
char
*
cmdline
,
**
xargv
=
NULL
,
*
ptr
;
WCHAR
*
wcmdline
,
**
wxargv
=
NULL
,
*
wptr
;
int
xargc
,
end
,
last_arg
,
afterlastspace
,
count
;
DWORD
version
;
...
...
@@ -222,9 +225,9 @@ void msvcrt_init_args(void)
TRACE
(
"found %d arguments
\n
"
,
MSVCRT___argc
);
env
=
GetEnvironmentStringsA
();
env
iron_strings
=
GetEnvironmentStringsA
();
count
=
1
;
/* for NULL sentinel */
for
(
ptr
=
env
;
*
ptr
;
ptr
+=
strlen
(
ptr
)
+
1
)
for
(
ptr
=
env
iron_strings
;
*
ptr
;
ptr
+=
strlen
(
ptr
)
+
1
)
{
count
++
;
}
...
...
@@ -232,7 +235,7 @@ void msvcrt_init_args(void)
if
(
MSVCRT__environ
)
{
count
=
0
;
for
(
ptr
=
env
;
*
ptr
;
ptr
+=
strlen
(
ptr
)
+
1
)
for
(
ptr
=
env
iron_strings
;
*
ptr
;
ptr
+=
strlen
(
ptr
)
+
1
)
{
MSVCRT__environ
[
count
++
]
=
ptr
;
}
...
...
@@ -241,9 +244,9 @@ void msvcrt_init_args(void)
MSVCRT___initenv
=
MSVCRT__environ
;
wenv
=
GetEnvironmentStringsW
();
wenv
iron_strings
=
GetEnvironmentStringsW
();
count
=
1
;
/* for NULL sentinel */
for
(
wptr
=
wenv
;
*
wptr
;
wptr
+=
lstrlenW
(
wptr
)
+
1
)
for
(
wptr
=
wenv
iron_strings
;
*
wptr
;
wptr
+=
lstrlenW
(
wptr
)
+
1
)
{
count
++
;
}
...
...
@@ -251,7 +254,7 @@ void msvcrt_init_args(void)
if
(
MSVCRT__wenviron
)
{
count
=
0
;
for
(
wptr
=
wenv
;
*
wptr
;
wptr
+=
lstrlenW
(
wptr
)
+
1
)
for
(
wptr
=
wenv
iron_strings
;
*
wptr
;
wptr
+=
lstrlenW
(
wptr
)
+
1
)
{
MSVCRT__wenviron
[
count
++
]
=
wptr
;
}
...
...
@@ -264,7 +267,9 @@ void msvcrt_init_args(void)
/* INTERNAL: free memory used by args */
void
msvcrt_free_args
(
void
)
{
/* FIXME */
/* FIXME: more things to free */
FreeEnvironmentStringsA
(
environ_strings
);
FreeEnvironmentStringsW
(
wenviron_strings
);
}
/*********************************************************************
...
...
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