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
82947221
Commit
82947221
authored
Oct 30, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Pass SYNCHRONIZE flag to NtOpenFile.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b4eab714
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
file.c
dlls/kernel32/file.c
+3
-3
path.c
dlls/kernel32/path.c
+3
-3
sync.c
dlls/kernel32/sync.c
+1
-1
volume.c
dlls/kernel32/volume.c
+5
-5
No files found.
dlls/kernel32/file.c
View file @
82947221
...
@@ -2038,7 +2038,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
...
@@ -2038,7 +2038,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtOpenFile
(
&
info
->
handle
,
GENERIC_READ
,
&
attr
,
&
io
,
status
=
NtOpenFile
(
&
info
->
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
...
@@ -2440,7 +2440,7 @@ BOOL WINAPI SetFileAttributesW( LPCWSTR name, DWORD attributes )
...
@@ -2440,7 +2440,7 @@ BOOL WINAPI SetFileAttributesW( LPCWSTR name, DWORD attributes )
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtOpenFile
(
&
handle
,
0
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
status
=
NtOpenFile
(
&
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
RtlFreeUnicodeString
(
&
nt_name
);
RtlFreeUnicodeString
(
&
nt_name
);
if
(
status
==
STATUS_SUCCESS
)
if
(
status
==
STATUS_SUCCESS
)
...
@@ -2572,7 +2572,7 @@ DWORD WINAPI GetCompressedFileSizeW(
...
@@ -2572,7 +2572,7 @@ DWORD WINAPI GetCompressedFileSizeW(
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtOpenFile
(
&
handle
,
0
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
status
=
NtOpenFile
(
&
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
RtlFreeUnicodeString
(
&
nt_name
);
RtlFreeUnicodeString
(
&
nt_name
);
if
(
status
==
STATUS_SUCCESS
)
if
(
status
==
STATUS_SUCCESS
)
...
...
dlls/kernel32/path.c
View file @
82947221
...
@@ -1280,7 +1280,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
...
@@ -1280,7 +1280,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtOpenFile
(
&
source_handle
,
0
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
status
=
NtOpenFile
(
&
source_handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
if
(
status
==
STATUS_SUCCESS
)
if
(
status
==
STATUS_SUCCESS
)
status
=
wine_nt_to_unix_file_name
(
&
nt_name
,
&
source_unix
,
FILE_OPEN
,
FALSE
);
status
=
wine_nt_to_unix_file_name
(
&
nt_name
,
&
source_unix
,
FILE_OPEN
,
FALSE
);
RtlFreeUnicodeString
(
&
nt_name
);
RtlFreeUnicodeString
(
&
nt_name
);
...
@@ -1304,7 +1304,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
...
@@ -1304,7 +1304,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
SetLastError
(
ERROR_PATH_NOT_FOUND
);
SetLastError
(
ERROR_PATH_NOT_FOUND
);
goto
error
;
goto
error
;
}
}
status
=
NtOpenFile
(
&
dest_handle
,
GENERIC_READ
|
GENERIC_WRITE
,
&
attr
,
&
io
,
0
,
status
=
NtOpenFile
(
&
dest_handle
,
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
if
(
status
==
STATUS_SUCCESS
)
/* destination exists */
if
(
status
==
STATUS_SUCCESS
)
/* destination exists */
{
{
...
@@ -1643,7 +1643,7 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
...
@@ -1643,7 +1643,7 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtOpenFile
(
&
handle
,
DELETE
,
&
attr
,
&
io
,
status
=
NtOpenFile
(
&
handle
,
DELETE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
if
(
status
==
STATUS_SUCCESS
)
if
(
status
==
STATUS_SUCCESS
)
...
...
dlls/kernel32/sync.c
View file @
82947221
...
@@ -1547,7 +1547,7 @@ BOOL WINAPI WaitNamedPipeW (LPCWSTR name, DWORD nTimeOut)
...
@@ -1547,7 +1547,7 @@ BOOL WINAPI WaitNamedPipeW (LPCWSTR name, DWORD nTimeOut)
pipe_dev_name
.
Length
=
sizeof
(
leadin
);
pipe_dev_name
.
Length
=
sizeof
(
leadin
);
pipe_dev_name
.
MaximumLength
=
sizeof
(
leadin
);
pipe_dev_name
.
MaximumLength
=
sizeof
(
leadin
);
InitializeObjectAttributes
(
&
attr
,
&
pipe_dev_name
,
OBJ_CASE_INSENSITIVE
,
NULL
,
NULL
);
InitializeObjectAttributes
(
&
attr
,
&
pipe_dev_name
,
OBJ_CASE_INSENSITIVE
,
NULL
,
NULL
);
status
=
NtOpenFile
(
&
pipe_dev
,
FILE_READ_ATTRIBUTES
,
&
attr
,
status
=
NtOpenFile
(
&
pipe_dev
,
FILE_READ_ATTRIBUTES
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
&
iosb
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SYNCHRONOUS_IO_NONALERT
);
FILE_SYNCHRONOUS_IO_NONALERT
);
if
(
status
!=
ERROR_SUCCESS
)
if
(
status
!=
ERROR_SUCCESS
)
...
...
dlls/kernel32/volume.c
View file @
82947221
...
@@ -171,7 +171,7 @@ static BOOL open_device_root( LPCWSTR root, HANDLE *handle )
...
@@ -171,7 +171,7 @@ static BOOL open_device_root( LPCWSTR root, HANDLE *handle )
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtOpenFile
(
handle
,
0
,
&
attr
,
&
io
,
0
,
status
=
NtOpenFile
(
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
RtlFreeUnicodeString
(
&
nt_name
);
RtlFreeUnicodeString
(
&
nt_name
);
if
(
status
!=
STATUS_SUCCESS
)
if
(
status
!=
STATUS_SUCCESS
)
...
@@ -235,7 +235,7 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW
...
@@ -235,7 +235,7 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW
memcpy
(
name
.
Buffer
,
device
->
Buffer
,
device
->
Length
);
memcpy
(
name
.
Buffer
,
device
->
Buffer
,
device
->
Length
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
labelW
,
sizeof
(
labelW
)
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
labelW
,
sizeof
(
labelW
)
);
if
(
!
NtOpenFile
(
&
handle
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
if
(
!
NtOpenFile
(
&
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
))
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
))
{
{
char
buffer
[
256
],
*
p
;
char
buffer
[
256
],
*
p
;
...
@@ -275,7 +275,7 @@ static DWORD get_filesystem_serial( const UNICODE_STRING *device )
...
@@ -275,7 +275,7 @@ static DWORD get_filesystem_serial( const UNICODE_STRING *device )
memcpy
(
name
.
Buffer
,
device
->
Buffer
,
device
->
Length
);
memcpy
(
name
.
Buffer
,
device
->
Buffer
,
device
->
Length
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
serialW
,
sizeof
(
serialW
)
);
memcpy
(
name
.
Buffer
+
device
->
Length
/
sizeof
(
WCHAR
),
serialW
,
sizeof
(
serialW
)
);
if
(
!
NtOpenFile
(
&
handle
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
if
(
!
NtOpenFile
(
&
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SYNCHRONOUS_IO_NONALERT
))
FILE_SYNCHRONOUS_IO_NONALERT
))
{
{
char
buffer
[
32
];
char
buffer
[
32
];
...
@@ -765,7 +765,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len,
...
@@ -765,7 +765,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len,
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
nt_name
.
Length
-=
sizeof
(
WCHAR
);
/* without trailing slash */
nt_name
.
Length
-=
sizeof
(
WCHAR
);
/* without trailing slash */
status
=
NtOpenFile
(
&
handle
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
status
=
NtOpenFile
(
&
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
nt_name
.
Length
+=
sizeof
(
WCHAR
);
nt_name
.
Length
+=
sizeof
(
WCHAR
);
...
@@ -811,7 +811,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len,
...
@@ -811,7 +811,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len,
/* we couldn't open the device, fallback to default strategy */
/* we couldn't open the device, fallback to default strategy */
status
=
NtOpenFile
(
&
handle
,
0
,
&
attr
,
&
io
,
0
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
status
=
NtOpenFile
(
&
handle
,
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
if
(
status
!=
STATUS_SUCCESS
)
if
(
status
!=
STATUS_SUCCESS
)
{
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
...
...
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