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
c19d1665
Commit
c19d1665
authored
Aug 23, 2011
by
Bernhard Loos
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: CreateFile uses an nonalertable io mode.
parent
69afb098
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
file.c
dlls/kernel32/file.c
+1
-1
file.c
dlls/kernel32/tests/file.c
+18
-0
No files found.
dlls/kernel32/file.c
View file @
c19d1665
...
@@ -1361,7 +1361,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
...
@@ -1361,7 +1361,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
if
(
attributes
&
FILE_FLAG_NO_BUFFERING
)
if
(
attributes
&
FILE_FLAG_NO_BUFFERING
)
options
|=
FILE_NO_INTERMEDIATE_BUFFERING
;
options
|=
FILE_NO_INTERMEDIATE_BUFFERING
;
if
(
!
(
attributes
&
FILE_FLAG_OVERLAPPED
))
if
(
!
(
attributes
&
FILE_FLAG_OVERLAPPED
))
options
|=
FILE_SYNCHRONOUS_IO_ALERT
;
options
|=
FILE_SYNCHRONOUS_IO_
NON
ALERT
;
if
(
attributes
&
FILE_FLAG_RANDOM_ACCESS
)
if
(
attributes
&
FILE_FLAG_RANDOM_ACCESS
)
options
|=
FILE_RANDOM_ACCESS
;
options
|=
FILE_RANDOM_ACCESS
;
attributes
&=
FILE_ATTRIBUTE_VALID_FLAGS
;
attributes
&=
FILE_ATTRIBUTE_VALID_FLAGS
;
...
...
dlls/kernel32/tests/file.c
View file @
c19d1665
...
@@ -38,6 +38,7 @@ static BOOL (WINAPI *pReplaceFileA)(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOI
...
@@ -38,6 +38,7 @@ static BOOL (WINAPI *pReplaceFileA)(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOI
static
BOOL
(
WINAPI
*
pReplaceFileW
)(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
DWORD
,
LPVOID
,
LPVOID
);
static
BOOL
(
WINAPI
*
pReplaceFileW
)(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
DWORD
,
LPVOID
,
LPVOID
);
static
UINT
(
WINAPI
*
pGetSystemWindowsDirectoryA
)(
LPSTR
,
UINT
);
static
UINT
(
WINAPI
*
pGetSystemWindowsDirectoryA
)(
LPSTR
,
UINT
);
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointA
)(
LPCSTR
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointA
)(
LPCSTR
,
LPSTR
,
DWORD
);
static
DWORD
WINAPI
(
*
pQueueUserAPC
)(
PAPCFUNC
pfnAPC
,
HANDLE
hThread
,
ULONG_PTR
dwData
);
/* keep filename and filenameW the same */
/* keep filename and filenameW the same */
static
const
char
filename
[]
=
"testfile.xxx"
;
static
const
char
filename
[]
=
"testfile.xxx"
;
...
@@ -71,6 +72,7 @@ static void InitFunctionPointers(void)
...
@@ -71,6 +72,7 @@ static void InitFunctionPointers(void)
pReplaceFileW
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"ReplaceFileW"
);
pReplaceFileW
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"ReplaceFileW"
);
pGetSystemWindowsDirectoryA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetSystemWindowsDirectoryA"
);
pGetSystemWindowsDirectoryA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetSystemWindowsDirectoryA"
);
pGetVolumeNameForVolumeMountPointA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetVolumeNameForVolumeMountPointA"
);
pGetVolumeNameForVolumeMountPointA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetVolumeNameForVolumeMountPointA"
);
pQueueUserAPC
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"QueueUserAPC"
);
}
}
static
void
test__hread
(
void
)
static
void
test__hread
(
void
)
...
@@ -2362,6 +2364,12 @@ static void test_async_file_errors(void)
...
@@ -2362,6 +2364,12 @@ static void test_async_file_errors(void)
HeapFree
(
GetProcessHeap
(),
0
,
lpBuffer
);
HeapFree
(
GetProcessHeap
(),
0
,
lpBuffer
);
}
}
static
BOOL
user_apc_ran
;
static
void
CALLBACK
user_apc
(
ULONG_PTR
param
)
{
user_apc_ran
=
TRUE
;
}
static
void
test_read_write
(
void
)
static
void
test_read_write
(
void
)
{
{
DWORD
bytes
,
ret
,
old_prot
;
DWORD
bytes
,
ret
,
old_prot
;
...
@@ -2382,6 +2390,12 @@ static void test_read_write(void)
...
@@ -2382,6 +2390,12 @@ static void test_read_write(void)
CREATE_ALWAYS
,
FILE_FLAG_RANDOM_ACCESS
,
0
);
CREATE_ALWAYS
,
FILE_FLAG_RANDOM_ACCESS
,
0
);
ok
(
hFile
!=
INVALID_HANDLE_VALUE
,
"CreateFileA: error %d
\n
"
,
GetLastError
());
ok
(
hFile
!=
INVALID_HANDLE_VALUE
,
"CreateFileA: error %d
\n
"
,
GetLastError
());
user_apc_ran
=
FALSE
;
if
(
pQueueUserAPC
)
{
trace
(
"Queueing an user APC
\n
"
);
/* verify the file is non alerable */
ok
(
pQueueUserAPC
(
&
user_apc
,
GetCurrentThread
(),
0
),
"QueueUserAPC failed: %d
\n
"
,
GetLastError
());
}
SetLastError
(
12345678
);
SetLastError
(
12345678
);
bytes
=
12345678
;
bytes
=
12345678
;
ret
=
WriteFile
(
hFile
,
NULL
,
0
,
&
bytes
,
NULL
);
ret
=
WriteFile
(
hFile
,
NULL
,
0
,
&
bytes
,
NULL
);
...
@@ -2418,6 +2432,10 @@ static void test_read_write(void)
...
@@ -2418,6 +2432,10 @@ static void test_read_write(void)
"ret = %d, error %d
\n
"
,
ret
,
GetLastError
());
"ret = %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
!
bytes
,
"bytes = %d
\n
"
,
bytes
);
ok
(
!
bytes
,
"bytes = %d
\n
"
,
bytes
);
ok
(
user_apc_ran
==
FALSE
,
"UserAPC ran, file using alertable io mode
\n
"
);
if
(
pQueueUserAPC
)
SleepEx
(
0
,
TRUE
);
/* get rid of apc */
/* test passing protected memory as buffer */
/* test passing protected memory as buffer */
mem
=
VirtualAlloc
(
NULL
,
0x4000
,
MEM_COMMIT
,
PAGE_READWRITE
);
mem
=
VirtualAlloc
(
NULL
,
0x4000
,
MEM_COMMIT
,
PAGE_READWRITE
);
...
...
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