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
eea358e6
Commit
eea358e6
authored
Nov 04, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Use CRT allocation functions.
parent
bb6bcaf8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
19 deletions
+18
-19
devinst.c
dlls/setupapi/tests/devinst.c
+2
-3
install.c
dlls/setupapi/tests/install.c
+3
-3
misc.c
dlls/setupapi/tests/misc.c
+4
-4
query.c
dlls/setupapi/tests/query.c
+9
-9
No files found.
dlls/setupapi/tests/devinst.c
View file @
eea358e6
...
...
@@ -33,7 +33,6 @@
#include "cfgmgr32.h"
#include "cguid.h"
#include "wine/heap.h"
#include "wine/test.h"
/* This is a unique guid for testing purposes */
...
...
@@ -1233,7 +1232,7 @@ static void test_device_iface_detail(void)
expected_size
=
FIELD_OFFSET
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
,
DevicePath
[
strlen
(
path
)
+
1
]);
ok
(
size
==
expected_size
,
"Expected size %lu, got %lu.
\n
"
,
expected_size
,
size
);
detail
=
heap_
alloc
(
size
*
2
);
detail
=
m
alloc
(
size
*
2
);
detail
->
cbSize
=
0
;
SetLastError
(
0xdeadbeef
);
...
...
@@ -1283,7 +1282,7 @@ static void test_device_iface_detail(void)
ok
(
size
==
expected_size
,
"Expected size %lu, got %lu.
\n
"
,
expected_size
,
size
);
ok
(
IsEqualGUID
(
&
device
.
ClassGuid
,
&
guid
),
"Got unexpected class %s.
\n
"
,
wine_dbgstr_guid
(
&
device
.
ClassGuid
));
heap_
free
(
detail
);
free
(
detail
);
SetupDiDestroyDeviceInfoList
(
set
);
}
...
...
dlls/setupapi/tests/install.c
View file @
eea358e6
...
...
@@ -207,17 +207,17 @@ static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
{
LPSTR
tempname
;
tempname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_PATH
);
tempname
=
malloc
(
MAX_PATH
);
GetTempFileNameA
(
"."
,
"xx"
,
0
,
tempname
);
if
(
tempname
&&
(
strlen
(
tempname
)
<
(
unsigned
)
cbTempName
))
{
lstrcpyA
(
pszTempName
,
tempname
);
HeapFree
(
GetProcessHeap
(),
0
,
tempname
);
free
(
tempname
);
return
TRUE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
tempname
);
free
(
tempname
);
return
FALSE
;
}
...
...
dlls/setupapi/tests/misc.c
View file @
eea358e6
...
...
@@ -109,7 +109,7 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest)
res
=
SetupGetInfInformationA
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
NULL
,
0
,
&
size
);
ok
(
res
,
"SetupGetInfInformation failed with error %ld
\n
"
,
GetLastError
());
pspii
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
pspii
=
malloc
(
size
);
res
=
SetupGetInfInformationA
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
pspii
,
size
,
NULL
);
ok
(
res
,
"SetupGetInfInformation failed with error %ld
\n
"
,
GetLastError
());
...
...
@@ -125,7 +125,7 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest)
ok
(
!
spofi
.
OriginalCatalogName
[
0
],
"spofi.OriginalCatalogName should have been
\"\"
instead of
\"
%s
\"\n
"
,
spofi
.
OriginalCatalogName
);
ok
(
!
strcmp
(
original
,
spofi
.
OriginalInfName
),
"spofi.OriginalInfName of %s didn't match real original name %s
\n
"
,
spofi
.
OriginalInfName
,
original
);
HeapFree
(
GetProcessHeap
(),
0
,
pspii
);
free
(
pspii
);
SetupCloseInfFile
(
hinf
);
}
...
...
@@ -371,12 +371,12 @@ static BOOL compare_file_data(LPSTR file, const BYTE *data, DWORD size)
LPBYTE
buffer
;
handle
=
CreateFileA
(
file
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
buffer
=
malloc
(
size
);
if
(
buffer
)
{
ReadFile
(
handle
,
buffer
,
size
,
&
read
,
NULL
);
if
(
read
==
size
&&
!
memcmp
(
data
,
buffer
,
size
))
ret
=
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
}
CloseHandle
(
handle
);
return
ret
;
...
...
dlls/setupapi/tests/query.c
View file @
eea358e6
...
...
@@ -120,7 +120,7 @@ static BOOL check_info_filename(PSP_INF_INFORMATION info, LPSTR test)
if
(
!
SetupQueryInfFileInformationA
(
info
,
0
,
NULL
,
0
,
&
size
))
return
FALSE
;
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
filename
=
malloc
(
size
);
if
(
!
filename
)
return
FALSE
;
...
...
@@ -129,7 +129,7 @@ static BOOL check_info_filename(PSP_INF_INFORMATION info, LPSTR test)
if
(
!
lstrcmpiA
(
test
,
filename
))
ret
=
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
filename
);
free
(
filename
);
return
ret
;
}
...
...
@@ -142,7 +142,7 @@ static PSP_INF_INFORMATION alloc_inf_info(LPCSTR filename, DWORD search, PDWORD
if
(
!
ret
)
return
NULL
;
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
size
);
info
=
malloc
(
*
size
);
return
info
;
}
...
...
@@ -234,7 +234,7 @@ static void test_SetupGetInfInformation(void)
ret
=
SetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
size
,
NULL
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
info
=
malloc
(
size
);
/* try valid ReturnBuffer but too small size */
SetLastError
(
0xbeefcafe
);
...
...
@@ -248,7 +248,7 @@ static void test_SetupGetInfInformation(void)
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_filename
),
"Expected returned filename to be equal
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
free
(
info
);
/* try the INFINFO_INF_SPEC_IS_HINF search flag */
hinf
=
SetupOpenInfFileA
(
inf_filename
,
NULL
,
INF_STYLE_WIN4
,
NULL
);
...
...
@@ -269,7 +269,7 @@ static void test_SetupGetInfInformation(void)
}
ok
(
ret
,
"can't create inf file %lu
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
info
);
free
(
info
);
info
=
alloc_inf_info
(
"test.inf"
,
INFINFO_DEFAULT_SEARCH
,
&
size
);
/* check if system32 is searched for inf */
...
...
@@ -284,7 +284,7 @@ static void test_SetupGetInfInformation(void)
lstrcatA
(
inf_one
,
"test.inf"
);
create_inf_file
(
inf_one
,
inf_data1
,
sizeof
(
inf_data1
)
-
1
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
free
(
info
);
info
=
alloc_inf_info
(
"test.inf"
,
INFINFO_DEFAULT_SEARCH
,
&
size
);
/* test the INFINFO_DEFAULT_SEARCH search flag */
...
...
@@ -292,7 +292,7 @@ static void test_SetupGetInfInformation(void)
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed: %ld
\n
"
,
GetLastError
());
ok
(
check_info_filename
(
info
,
inf_one
),
"Expected returned filename to be equal
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
free
(
info
);
info
=
alloc_inf_info
(
"test.inf"
,
INFINFO_REVERSE_DEFAULT_SEARCH
,
&
size
);
/* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */
...
...
@@ -301,7 +301,7 @@ static void test_SetupGetInfInformation(void)
ok
(
check_info_filename
(
info
,
revfile
),
"Expected returned filename to be equal
\n
"
);
done:
HeapFree
(
GetProcessHeap
(),
0
,
info
);
free
(
info
);
DeleteFileA
(
inf_filename
);
DeleteFileA
(
inf_one
);
DeleteFileA
(
inf_two
);
...
...
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