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
9f76085c
Commit
9f76085c
authored
May 21, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: File mapping names are case sensitive.
parent
b62f3dee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
virtual.c
dlls/kernel32/tests/virtual.c
+40
-0
virtual.c
dlls/kernel32/virtual.c
+2
-3
No files found.
dlls/kernel32/tests/virtual.c
View file @
9f76085c
...
...
@@ -622,6 +622,45 @@ static void test_NtMapViewOfSection(void)
CloseHandle
(
hProcess
);
}
static
void
test_CreateFileMapping
(
void
)
{
HANDLE
handle
,
handle2
;
/* test case sensitivity */
SetLastError
(
0xdeadbeef
);
handle
=
CreateFileMappingA
(
INVALID_HANDLE_VALUE
,
NULL
,
SEC_COMMIT
|
PAGE_READWRITE
,
0
,
0x1000
,
__FILE__
": Test Mapping"
);
ok
(
handle
!=
NULL
,
"CreateFileMapping failed with error %u
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0
,
"wrong error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
handle2
=
CreateFileMappingA
(
INVALID_HANDLE_VALUE
,
NULL
,
SEC_COMMIT
|
PAGE_READWRITE
,
0
,
0x1000
,
__FILE__
": Test Mapping"
);
ok
(
handle2
!=
NULL
,
"CreateFileMapping failed with error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ALREADY_EXISTS
,
"wrong error %u
\n
"
,
GetLastError
());
CloseHandle
(
handle2
);
SetLastError
(
0xdeadbeef
);
handle2
=
CreateFileMappingA
(
INVALID_HANDLE_VALUE
,
NULL
,
SEC_COMMIT
|
PAGE_READWRITE
,
0
,
0x1000
,
__FILE__
": TEST MAPPING"
);
ok
(
handle2
!=
NULL
,
"CreateFileMapping failed with error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0
,
"wrong error %u
\n
"
,
GetLastError
());
CloseHandle
(
handle2
);
SetLastError
(
0xdeadbeef
);
handle2
=
OpenFileMappingA
(
FILE_MAP_ALL_ACCESS
,
FALSE
,
__FILE__
": Test Mapping"
);
ok
(
handle2
!=
NULL
,
"OpenFileMapping failed with error %d
\n
"
,
GetLastError
());
CloseHandle
(
handle2
);
SetLastError
(
0xdeadbeef
);
handle2
=
OpenFileMappingA
(
FILE_MAP_ALL_ACCESS
,
FALSE
,
__FILE__
": TEST MAPPING"
);
ok
(
!
handle2
,
"OpenFileMapping succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
());
CloseHandle
(
handle
);
}
static
void
test_BadPtr
(
void
)
{
void
*
ptr
=
(
void
*
)
1
;
...
...
@@ -667,5 +706,6 @@ START_TEST(virtual)
test_VirtualAlloc
();
test_MapViewOfFile
();
test_NtMapViewOfSection
();
test_CreateFileMapping
();
test_BadPtr
();
}
dlls/kernel32/virtual.c
View file @
9f76085c
...
...
@@ -347,8 +347,7 @@ HANDLE WINAPI CreateFileMappingW( HANDLE hFile, LPSECURITY_ATTRIBUTES sa,
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
NULL
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
OBJ_OPENIF
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
attr
.
Attributes
=
OBJ_OPENIF
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
...
...
@@ -451,7 +450,7 @@ HANDLE WINAPI OpenFileMappingW( DWORD access, BOOL inherit, LPCWSTR name)
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
get_BaseNamedObjects_handle
();
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
(
inherit
?
OBJ_INHERIT
:
0
)
;
attr
.
Attributes
=
inherit
?
OBJ_INHERIT
:
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
name
);
...
...
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