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
3eb49852
Commit
3eb49852
authored
Sep 07, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Sep 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupDuplicateDiskSpaceListA/W.
parent
beb3018b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
196 additions
and
2 deletions
+196
-2
diskspace.c
dlls/setupapi/diskspace.c
+38
-0
setupapi.spec
dlls/setupapi/setupapi.spec
+2
-2
diskspace.c
dlls/setupapi/tests/diskspace.c
+156
-0
No files found.
dlls/setupapi/diskspace.c
View file @
3eb49852
...
...
@@ -102,6 +102,44 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListA(PVOID Reserved1, DWORD Reserved2, UINT
return
SetupCreateDiskSpaceListW
(
Reserved1
,
Reserved2
,
Flags
);
}
/***********************************************************************
* SetupDuplicateDiskSpaceListW (SETUPAPI.@)
*/
HDSKSPC
WINAPI
SetupDuplicateDiskSpaceListW
(
HDSKSPC
DiskSpace
,
PVOID
Reserved1
,
DWORD
Reserved2
,
UINT
Flags
)
{
DISKSPACELIST
*
list_copy
,
*
list_original
=
DiskSpace
;
if
(
Reserved1
||
Reserved2
||
Flags
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
if
(
!
DiskSpace
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
NULL
;
}
list_copy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DISKSPACELIST
));
if
(
!
list_copy
)
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
NULL
;
}
*
list_copy
=
*
list_original
;
return
list_copy
;
}
/***********************************************************************
* SetupDuplicateDiskSpaceListA (SETUPAPI.@)
*/
HDSKSPC
WINAPI
SetupDuplicateDiskSpaceListA
(
HDSKSPC
DiskSpace
,
PVOID
Reserved1
,
DWORD
Reserved2
,
UINT
Flags
)
{
return
SetupDuplicateDiskSpaceListW
(
DiskSpace
,
Reserved1
,
Reserved2
,
Flags
);
}
/***********************************************************************
* SetupAddInstallSectionToDiskSpaceListA (SETUPAPI.@)
...
...
dlls/setupapi/setupapi.spec
View file @
3eb49852
...
...
@@ -391,8 +391,8 @@
@ stub SetupDiSetSelectedDriverA
@ stub SetupDiSetSelectedDriverW
@ stub SetupDiUnremoveDevice
@ st
ub SetupDuplicateDiskSpaceListA
@ st
ub SetupDuplicateDiskSpaceListW
@ st
dcall SetupDuplicateDiskSpaceListA(ptr ptr long long)
@ st
dcall SetupDuplicateDiskSpaceListW(ptr ptr long long)
@ stdcall SetupEnumInfSectionsA(long long ptr long ptr)
@ stdcall SetupEnumInfSectionsW(long long ptr long ptr)
@ stdcall SetupFindFirstLineA(long str str ptr)
...
...
dlls/setupapi/tests/diskspace.c
View file @
3eb49852
...
...
@@ -146,6 +146,160 @@ static void test_SetupCreateDiskSpaceListW(void)
GetLastError
());
}
static
void
test_SetupDuplicateDiskSpaceListA
(
void
)
{
HDSKSPC
handle
,
duplicate
;
int
is_win9x
=
!
SetupCreateDiskSpaceListW
((
void
*
)
0xdeadbeef
,
0xdeadbeef
,
0
)
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
;
if
(
is_win9x
)
win_skip
(
"SetupDuplicateDiskSpaceListA crashes with NULL disk space handle on Win9x
\n
"
);
else
{
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
NULL
,
NULL
,
0
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
NULL
,
(
void
*
)
0xdeadbeef
,
0
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
NULL
,
NULL
,
0xdeadbeef
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
NULL
,
NULL
,
0
,
~
0U
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
}
handle
=
SetupCreateDiskSpaceListA
(
NULL
,
0
,
0
);
ok
(
handle
!=
NULL
,
"Expected SetupCreateDiskSpaceListA to return a valid handle, got NULL
\n
"
);
if
(
!
handle
)
{
skip
(
"Failed to create a disk space handle
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
handle
,
(
void
*
)
0xdeadbeef
,
0
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
handle
,
NULL
,
0xdeadbeef
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
handle
,
NULL
,
0
,
SPDSL_IGNORE_DISK
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListA
(
handle
,
NULL
,
0
,
~
0U
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
duplicate
=
SetupDuplicateDiskSpaceListA
(
handle
,
NULL
,
0
,
0
);
ok
(
duplicate
!=
NULL
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
duplicate
!=
handle
,
"Expected new handle (%p) to be different from the old handle (%p)
\n
"
,
duplicate
,
handle
);
ok
(
SetupDestroyDiskSpaceList
(
duplicate
),
"Expected SetupDestroyDiskSpaceList to succeed
\n
"
);
ok
(
SetupDestroyDiskSpaceList
(
handle
),
"Expected SetupDestroyDiskSpaceList to succeed
\n
"
);
}
static
void
test_SetupDuplicateDiskSpaceListW
(
void
)
{
HDSKSPC
handle
,
duplicate
;
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
NULL
,
NULL
,
0
,
0
);
if
(
!
duplicate
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"SetupDuplicateDiskSpaceListW is not available
\n
"
);
return
;
}
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
NULL
,
(
void
*
)
0xdeadbeef
,
0
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
NULL
,
NULL
,
0xdeadbeef
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
NULL
,
NULL
,
0
,
~
0U
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
handle
=
SetupCreateDiskSpaceListW
(
NULL
,
0
,
0
);
ok
(
handle
!=
NULL
,
"Expected SetupCreateDiskSpaceListW to return a valid handle, got NULL
\n
"
);
if
(
!
handle
)
{
skip
(
"Failed to create a disk space handle
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
handle
,
(
void
*
)
0xdeadbeef
,
0
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
handle
,
NULL
,
0xdeadbeef
,
0
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
handle
,
NULL
,
0
,
SPDSL_IGNORE_DISK
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
duplicate
=
SetupDuplicateDiskSpaceListW
(
handle
,
NULL
,
0
,
~
0U
);
ok
(
!
duplicate
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u
\n
"
,
GetLastError
());
duplicate
=
SetupDuplicateDiskSpaceListW
(
handle
,
NULL
,
0
,
0
);
ok
(
duplicate
!=
NULL
,
"Expected SetupDuplicateDiskSpaceList to return NULL, got %p
\n
"
,
duplicate
);
ok
(
duplicate
!=
handle
,
"Expected new handle (%p) to be different from the old handle (%p)
\n
"
,
duplicate
,
handle
);
ok
(
SetupDestroyDiskSpaceList
(
duplicate
),
"Expected SetupDestroyDiskSpaceList to succeed
\n
"
);
ok
(
SetupDestroyDiskSpaceList
(
handle
),
"Expected SetupDestroyDiskSpaceList to succeed
\n
"
);
}
static
void
test_SetupQuerySpaceRequiredOnDriveA
(
void
)
{
BOOL
ret
;
...
...
@@ -324,6 +478,8 @@ START_TEST(diskspace)
{
test_SetupCreateDiskSpaceListA
();
test_SetupCreateDiskSpaceListW
();
test_SetupDuplicateDiskSpaceListA
();
test_SetupDuplicateDiskSpaceListW
();
test_SetupQuerySpaceRequiredOnDriveA
();
test_SetupQuerySpaceRequiredOnDriveW
();
}
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