Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
61ad36fd
Commit
61ad36fd
authored
Mar 26, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
krnl386: Return a handle to the vxd file itself instead of creating a dummy file.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7b10b024
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
47 deletions
+4
-47
vxd.c
dlls/krnl386.exe16/vxd.c
+4
-47
No files found.
dlls/krnl386.exe16/vxd.c
View file @
61ad36fd
...
...
@@ -108,51 +108,6 @@ static WORD VXD_WinVersion(void)
return
(
version
>>
8
)
|
(
version
<<
8
);
}
/* create a file handle to represent a VxD, by opening a dummy file in the wineserver directory */
static
HANDLE
open_vxd_handle
(
LPCWSTR
name
)
{
static
const
WCHAR
prefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'u'
,
'n'
,
'i'
,
'x'
};
const
char
*
dir
=
wine_get_server_dir
();
int
len
;
HANDLE
ret
;
NTSTATUS
status
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
IO_STATUS_BLOCK
io
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
NULL
,
0
);
nameW
.
Length
=
sizeof
(
prefixW
)
+
(
len
+
strlenW
(
name
))
*
sizeof
(
WCHAR
);
nameW
.
MaximumLength
=
nameW
.
Length
+
sizeof
(
WCHAR
);
if
(
!
(
nameW
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nameW
.
MaximumLength
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
0
;
}
memcpy
(
nameW
.
Buffer
,
prefixW
,
sizeof
(
prefixW
)
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
+
ARRAY_SIZE
(
prefixW
),
len
);
len
+=
ARRAY_SIZE
(
prefixW
);
nameW
.
Buffer
[
len
-
1
]
=
'/'
;
strcpyW
(
nameW
.
Buffer
+
len
,
name
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
0
;
attr
.
ObjectName
=
&
nameW
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
NtCreateFile
(
&
ret
,
SYNCHRONIZE
,
&
attr
,
&
io
,
NULL
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_OPEN_IF
,
FILE_SYNCHRONOUS_IO_ALERT
,
NULL
,
0
);
if
(
status
)
{
ret
=
0
;
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
}
RtlFreeUnicodeString
(
&
nameW
);
return
ret
;
}
/* retrieve the DeviceIoControl function for a Vxd given a file handle */
DeviceIoProc
__wine_vxd_get_proc
(
HANDLE
handle
)
{
...
...
@@ -240,11 +195,13 @@ HANDLE __wine_vxd_open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa
}
if
(
!
vxd_modules
[
i
].
module
)
/* new one, register it */
{
WCHAR
path
[
MAX_PATH
];
IO_STATUS_BLOCK
io
;
FILE_INTERNAL_INFORMATION
info
;
/* get a file handle to the dummy file */
if
(
!
(
handle
=
open_vxd_handle
(
name
)))
GetModuleFileNameW
(
module
,
path
,
MAX_PATH
);
handle
=
CreateFileW
(
path
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
FreeLibrary
(
module
);
goto
done
;
...
...
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