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
33ca67dc
Commit
33ca67dc
authored
Aug 17, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Aug 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix profile sharing mode.
Based on a patch from Austin English.
parent
4603c873
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
profile.c
dlls/kernel32/profile.c
+1
-1
profile.c
dlls/kernel32/tests/profile.c
+22
-0
No files found.
dlls/kernel32/profile.c
View file @
33ca67dc
...
...
@@ -755,7 +755,7 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
TRACE
(
"path: %s
\n
"
,
debugstr_w
(
buffer
));
hFile
=
CreateFileW
(
buffer
,
GENERIC_READ
|
(
write_access
?
GENERIC_WRITE
:
0
),
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
((
hFile
==
INVALID_HANDLE_VALUE
)
&&
(
GetLastError
()
!=
ERROR_FILE_NOT_FOUND
))
...
...
dlls/kernel32/tests/profile.c
View file @
33ca67dc
...
...
@@ -348,6 +348,27 @@ static void test_profile_existing(void)
ok
(
DeleteFile
(
testfile2
),
"delete failed
\n
"
);
}
static
void
test_profile_delete_on_close
()
{
static
CHAR
testfile
[]
=
".
\\
testwine5.ini"
;
HANDLE
h
;
DWORD
size
,
res
;
static
const
char
contents
[]
=
"["
SECTION
"]
\n
"
KEY
"=123
\n
"
;
h
=
CreateFile
(
testfile
,
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
CREATE_ALWAYS
,
FILE_FLAG_DELETE_ON_CLOSE
,
NULL
);
ok
(
WriteFile
(
h
,
contents
,
sizeof
contents
-
1
,
&
size
,
NULL
),
"Cannot write test file: %x
\n
"
,
GetLastError
()
);
ok
(
size
==
sizeof
contents
-
1
,
"Test file: partial write
\n
"
);
res
=
GetPrivateProfileInt
(
SECTION
,
KEY
,
0
,
testfile
);
ok
(
res
==
123
,
"Got %d instead of 123
\n
"
,
res
);
/* This also deletes the file */
CloseHandle
(
h
);
}
static
void
create_test_file
(
LPCSTR
name
,
LPCSTR
data
,
DWORD
size
)
{
HANDLE
hfile
;
...
...
@@ -615,5 +636,6 @@ START_TEST(profile)
test_profile_sections
();
test_profile_sections_names
();
test_profile_existing
();
test_profile_delete_on_close
();
test_GetPrivateProfileString
();
}
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