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
3aa4feb5
Commit
3aa4feb5
authored
Jul 08, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Use wine_get_dos_file_name() instead of wine_unix_to_nt_file_name().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f8699c0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
22 deletions
+19
-22
device.c
dlls/mountmgr.sys/device.c
+8
-14
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+11
-8
No files found.
dlls/mountmgr.sys/device.c
View file @
3aa4feb5
...
@@ -1017,32 +1017,26 @@ static struct volume *find_matching_volume( const char *udi, const char *device,
...
@@ -1017,32 +1017,26 @@ static struct volume *find_matching_volume( const char *udi, const char *device,
static
BOOL
get_volume_device_info
(
struct
volume
*
volume
)
static
BOOL
get_volume_device_info
(
struct
volume
*
volume
)
{
{
const
char
*
unix_device
=
volume
->
device
->
unix_device
;
const
char
*
unix_device
=
volume
->
device
->
unix_device
;
ANSI_STRING
unix_name
;
WCHAR
*
name
;
UNICODE_STRING
nt_name
;
OBJECT_ATTRIBUTES
attr
;
HANDLE
handle
;
HANDLE
handle
;
NTSTATUS
ret
;
CDROM_TOC
toc
;
CDROM_TOC
toc
;
DWORD
size
;
DWORD
size
;
BYTE
superblock
[
SUPERBLOCK_SIZE
];
BYTE
superblock
[
SUPERBLOCK_SIZE
];
IO_STATUS_BLOCK
io
;
if
(
!
unix_device
)
if
(
!
unix_device
)
return
FALSE
;
return
FALSE
;
RtlInitAnsiString
(
&
unix_name
,
unix_device
);
if
(
!
(
name
=
wine_get_dos_file_name
(
unix_device
)))
if
((
ret
=
wine_unix_to_nt_file_name
(
&
unix_name
,
&
nt_name
)))
{
{
ERR
(
"Failed to convert %s to NT,
status %#x
\n
"
,
debugstr_a
(
unix_device
),
ret
);
ERR
(
"Failed to convert %s to NT,
err %u
\n
"
,
debugstr_a
(
unix_device
),
GetLastError
()
);
return
FALSE
;
return
FALSE
;
}
}
handle
=
CreateFileW
(
name
,
GENERIC_READ
|
SYNCHRONIZE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
InitializeObjectAttributes
(
&
attr
,
&
nt_name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
((
ret
=
NtOpenFile
(
&
handle
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
RtlFreeHeap
(
GetProcessHeap
(),
0
,
name
);
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
))
)
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
{
WARN
(
"Failed to open %s, status %#x
\n
"
,
debugstr_a
(
unix_device
),
ret
);
WARN
(
"Failed to open %s, err %u
\n
"
,
debugstr_a
(
unix_device
),
GetLastError
());
RtlFreeUnicodeString
(
&
nt_name
);
return
FALSE
;
return
FALSE
;
}
}
...
...
dlls/mountmgr.sys/mountmgr.c
View file @
3aa4feb5
...
@@ -432,7 +432,7 @@ static void WINAPI query_symbol_file( TP_CALLBACK_INSTANCE *instance, void *cont
...
@@ -432,7 +432,7 @@ static void WINAPI query_symbol_file( TP_CALLBACK_INSTANCE *instance, void *cont
IRP
*
irp
=
context
;
IRP
*
irp
=
context
;
MOUNTMGR_TARGET_NAME
*
result
;
MOUNTMGR_TARGET_NAME
*
result
;
CFStringRef
query_cfstring
;
CFStringRef
query_cfstring
;
WCHAR
*
unix_buf
=
NULL
;
WCHAR
*
filename
,
*
unix_buf
=
NULL
;
ANSI_STRING
unix_path
;
ANSI_STRING
unix_path
;
UNICODE_STRING
path
;
UNICODE_STRING
path
;
MDQueryRef
mdquery
;
MDQueryRef
mdquery
;
...
@@ -489,16 +489,19 @@ static void WINAPI query_symbol_file( TP_CALLBACK_INSTANCE *instance, void *cont
...
@@ -489,16 +489,19 @@ static void WINAPI query_symbol_file( TP_CALLBACK_INSTANCE *instance, void *cont
HeapFree
(
GetProcessHeap
(),
0
,
unix_buf
);
HeapFree
(
GetProcessHeap
(),
0
,
unix_buf
);
if
(
status
)
goto
done
;
if
(
status
)
goto
done
;
status
=
wine_unix_to_nt_file_name
(
&
unix_path
,
&
path
);
filename
=
wine_get_dos_file_name
(
unix_path
.
Buffer
);
RtlFreeAnsiString
(
&
unix_path
);
RtlFreeAnsiString
(
&
unix_path
);
if
(
status
)
goto
done
;
if
(
!
filename
)
{
status
=
STATUS_NO_SUCH_FILE
;
goto
done
;
}
result
=
irp
->
AssociatedIrp
.
SystemBuffer
;
result
=
irp
->
AssociatedIrp
.
SystemBuffer
;
result
->
DeviceNameLength
=
path
.
Length
;
result
->
DeviceNameLength
=
lstrlenW
(
filename
)
*
sizeof
(
WCHAR
)
;
size
=
FIELD_OFFSET
(
MOUNTMGR_TARGET_NAME
,
DeviceName
[
path
.
Length
/
sizeof
(
WCHAR
)]);
size
=
FIELD_OFFSET
(
MOUNTMGR_TARGET_NAME
,
DeviceName
[
lstrlenW
(
filename
)]);
if
(
size
<=
IoGetCurrentIrpStackLocation
(
irp
)
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
)
if
(
size
<=
IoGetCurrentIrpStackLocation
(
irp
)
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
)
{
{
memcpy
(
result
->
DeviceName
,
path
.
Buffer
,
path
.
Length
);
memcpy
(
result
->
DeviceName
,
filename
,
lstrlenW
(
filename
)
*
sizeof
(
WCHAR
)
);
irp
->
IoStatus
.
Information
=
size
;
irp
->
IoStatus
.
Information
=
size
;
status
=
STATUS_SUCCESS
;
status
=
STATUS_SUCCESS
;
}
}
...
@@ -507,7 +510,7 @@ static void WINAPI query_symbol_file( TP_CALLBACK_INSTANCE *instance, void *cont
...
@@ -507,7 +510,7 @@ static void WINAPI query_symbol_file( TP_CALLBACK_INSTANCE *instance, void *cont
irp
->
IoStatus
.
Information
=
sizeof
(
*
result
);
irp
->
IoStatus
.
Information
=
sizeof
(
*
result
);
status
=
STATUS_BUFFER_OVERFLOW
;
status
=
STATUS_BUFFER_OVERFLOW
;
}
}
RtlFree
UnicodeString
(
&
path
);
RtlFree
Heap
(
GetProcessHeap
(),
0
,
filename
);
done:
done:
irp
->
IoStatus
.
u
.
Status
=
status
;
irp
->
IoStatus
.
u
.
Status
=
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