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
3f492390
Commit
3f492390
authored
Mar 14, 2007
by
Huw Davies
Committed by
Alexandre Julliard
Mar 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix GetPrivateProfileSectionNamesA when the file does not exist.
parent
f1172cd4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
profile.c
dlls/kernel32/profile.c
+2
-0
profile.c
dlls/kernel32/tests/profile.c
+14
-0
No files found.
dlls/kernel32/profile.c
View file @
3f492390
...
...
@@ -1629,6 +1629,8 @@ DWORD WINAPI GetPrivateProfileSectionNamesA( LPSTR buffer, DWORD size,
else
ret
=
ret
-
1
;
}
else
if
(
size
)
buffer
[
0
]
=
'\0'
;
RtlFreeUnicodeString
(
&
filenameW
);
HeapFree
(
GetProcessHeap
(),
0
,
bufferW
);
...
...
dlls/kernel32/tests/profile.c
View file @
3f492390
...
...
@@ -145,6 +145,7 @@ static void test_profile_sections(void)
static
const
char
content
[]
=
"[section1]
\r\n
[section2]
\r\n
[section3]
\r\n
"
;
static
const
char
testfile3
[]
=
".
\\
testwine3.ini"
;
static
const
WCHAR
testfile3W
[]
=
{
'.'
,
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'w'
,
'i'
,
'n'
,
'e'
,
'3'
,
'.'
,
'i'
,
'n'
,
'i'
,
0
};
static
const
WCHAR
not_here
[]
=
{
'.'
,
'\\'
,
'n'
,
'o'
,
't'
,
'_'
,
'h'
,
'e'
,
'r'
,
'e'
,
'.'
,
'i'
,
'n'
,
'i'
,
0
};
DeleteFileA
(
testfile3
);
h
=
CreateFileA
(
testfile3
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
...
...
@@ -185,6 +186,19 @@ static void test_profile_sections(void)
ok
(
buf
[
ret
+
1
]
==
0
&&
buf
[
ret
]
==
0
,
"returned buffer not terminated with double-null
\n
"
);
DeleteFileA
(
testfile3
);
/* Tests on non-existent file */
memset
(
buf
,
0xcc
,
sizeof
(
buf
));
ret
=
GetPrivateProfileSectionNamesA
(
buf
,
10
,
".
\\
not_here.ini"
);
ok
(
ret
==
0
,
"expected return size 0, got %d
\n
"
,
ret
);
ok
(
buf
[
0
]
==
0
,
"returned buffer not terminated with null
\n
"
);
ok
(
buf
[
1
]
!=
0
,
"returned buffer terminated with double-null
\n
"
);
memset
(
bufW
,
0xcc
,
sizeof
(
bufW
));
ret
=
GetPrivateProfileSectionNamesW
(
bufW
,
10
,
not_here
);
ok
(
ret
==
0
,
"expected return size 0, got %d
\n
"
,
ret
);
ok
(
bufW
[
0
]
==
0
,
"returned buffer not terminated with null
\n
"
);
ok
(
bufW
[
1
]
!=
0
,
"returned buffer terminated with double-null
\n
"
);
}
START_TEST
(
profile
)
...
...
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