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
1a833442
Commit
1a833442
authored
Apr 14, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced create_file server requests by a call to NtCreateFile.
parent
24935297
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
33 deletions
+57
-33
vxd.c
dlls/kernel/vxd.c
+30
-12
int21.c
dlls/winedos/int21.c
+27
-21
No files found.
dlls/kernel/vxd.c
View file @
1a833442
...
...
@@ -91,23 +91,41 @@ static CRITICAL_SECTION vxd_section = { &critsect_debug, -1, 0, 0, 0, 0 };
static
HANDLE
open_vxd_handle
(
LPCWSTR
name
)
{
const
char
*
dir
=
wine_get_server_dir
();
char
*
unix_name
;
int
len1
,
len2
;
int
len
;
HANDLE
ret
;
len1
=
strlen
(
dir
);
len2
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
(
unix_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len1
+
len2
+
1
)))
NTSTATUS
status
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
IO_STATUS_BLOCK
io
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
NULL
,
0
);
nameW
.
Length
=
(
len
+
1
+
strlenW
(
name
))
*
sizeof
(
WCHAR
);
nameW
.
MaximumLength
=
nameW
.
Length
+
sizeof
(
WCHAR
);
if
(
!
(
nameW
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nameW
.
Length
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
0
;
}
strcpy
(
unix_name
,
dir
);
unix_name
[
len1
]
=
'/'
;
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
unix_name
+
len1
+
1
,
len2
,
NULL
,
NULL
);
ret
=
FILE_CreateFile
(
unix_name
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_ALWAYS
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
unix_name
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
,
len
);
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
,
0
,
&
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
;
}
...
...
dlls/winedos/int21.c
View file @
1a833442
...
...
@@ -801,35 +801,41 @@ static BOOL INT21_SetCurrentDirectory( CONTEXT86 *context )
static
HANDLE
INT21_CreateMagicDeviceHandle
(
LPCWSTR
name
)
{
const
char
*
dir
=
wine_get_server_dir
();
char
*
unix_name
;
int
len1
,
len2
;
HANDLE
ret
=
0
;
int
len
;
HANDLE
ret
;
NTSTATUS
status
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
IO_STATUS_BLOCK
io
;
len1
=
strlen
(
dir
);
len2
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
(
unix_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len1
+
len2
+
1
)))
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
NULL
,
0
);
nameW
.
Length
=
(
len
+
1
+
strlenW
(
name
))
*
sizeof
(
WCHAR
);
nameW
.
MaximumLength
=
nameW
.
Length
+
sizeof
(
WCHAR
);
if
(
!
(
nameW
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nameW
.
Length
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
0
;
}
strcpy
(
unix_name
,
dir
);
unix_name
[
len1
]
=
'/'
;
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
name
,
-
1
,
unix_name
+
len1
+
1
,
len2
,
NULL
,
NULL
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
,
len
);
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
;
SERVER_START_REQ
(
create_file
)
status
=
NtCreateFile
(
&
ret
,
GENERIC_READ
|
GENERIC_WRITE
,
&
attr
,
&
io
,
NULL
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_OPEN_IF
,
FILE_SYNCHRONOUS_IO_ALERT
,
NULL
,
0
);
if
(
status
)
{
req
->
access
=
GENERIC_READ
|
GENERIC_WRITE
;
req
->
inherit
=
0
;
req
->
sharing
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
req
->
create
=
FILE_OPEN_IF
;
req
->
options
=
FILE_SYNCHRONOUS_IO_ALERT
;
req
->
attrs
=
0
;
wine_server_add_data
(
req
,
unix_name
,
strlen
(
unix_name
)
);
SetLastError
(
0
);
if
(
!
wine_server_call_err
(
req
))
ret
=
reply
->
handle
;
ret
=
0
;
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
}
SERVER_END_REQ
;
HeapFree
(
GetProcessHeap
(),
0
,
unix_name
);
RtlFreeUnicodeString
(
&
nameW
);
return
ret
;
}
...
...
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