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
ec636f15
Commit
ec636f15
authored
Feb 28, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Avoid slashes and backslashes in user names.
parent
2d87a7bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
advapi.c
dlls/advapi32/advapi.c
+7
-1
No files found.
dlls/advapi32/advapi.c
View file @
ec636f15
...
...
@@ -84,7 +84,7 @@ BOOL WINAPI
GetUserNameW
(
LPWSTR
lpszName
,
LPDWORD
lpSize
)
{
const
char
*
name
=
wine_get_user_name
();
DWORD
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
name
,
-
1
,
NULL
,
0
);
DWORD
i
,
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
name
,
-
1
,
NULL
,
0
);
if
(
len
>
*
lpSize
)
{
...
...
@@ -95,6 +95,12 @@ GetUserNameW( LPWSTR lpszName, LPDWORD lpSize )
*
lpSize
=
len
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
name
,
-
1
,
lpszName
,
len
);
/* Word uses the user name to create named mutexes and file mappings,
* and backslashes in the name cause the creation to fail.
*/
for
(
i
=
0
;
lpszName
[
i
];
i
++
)
if
(
lpszName
[
i
]
==
'\\'
||
lpszName
[
i
]
==
'/'
)
lpszName
[
i
]
=
'_'
;
return
TRUE
;
}
...
...
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