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
7930ce12
Commit
7930ce12
authored
Apr 23, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use NtOpenFile instead of FILE_CreateFile to open Unix files.
parent
82c191f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
registry.c
misc/registry.c
+21
-2
No files found.
misc/registry.c
View file @
7930ce12
...
...
@@ -1199,9 +1199,27 @@ static int _get_reg_type(const WCHAR* windir)
/* load the registry file in wine format [Internal] */
static
void
load_wine_registry
(
HKEY
hkey
,
LPCSTR
fn
)
{
WCHAR
*
buffer
;
HANDLE
file
;
if
((
file
=
FILE_CreateFile
(
fn
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
0
)))
DWORD
len
;
UNICODE_STRING
name
;
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
fn
,
-
1
,
NULL
,
0
);
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
fn
,
-
1
,
buffer
,
len
);
RtlInitUnicodeString
(
&
name
,
buffer
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
ObjectName
=
&
name
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
!
NtOpenFile
(
&
file
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
))
{
SERVER_START_REQ
(
load_registry
)
{
...
...
@@ -1212,6 +1230,7 @@ static void load_wine_registry(HKEY hkey,LPCSTR fn)
SERVER_END_REQ
;
CloseHandle
(
file
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
/* generate and return the name of the tmp file and associated stream [Internal] */
...
...
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