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
35d0a7a0
Commit
35d0a7a0
authored
Oct 15, 2008
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Add test for ProfileItems directive.
parent
fff24b06
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
install.c
dlls/setupapi/tests/install.c
+70
-0
No files found.
dlls/setupapi/tests/install.c
View file @
35d0a7a0
...
...
@@ -30,6 +30,7 @@
#include "winreg.h"
#include "winsvc.h"
#include "setupapi.h"
#include "shlobj.h"
#include "wine/test.h"
...
...
@@ -382,6 +383,71 @@ static void test_driver_install(void)
DeleteFile
(
driver
);
}
static
void
test_profile_items
(
void
)
{
char
path
[
MAX_PATH
],
commonprogs
[
MAX_PATH
];
HMODULE
hShell32
;
BOOL
(
WINAPI
*
pSHGetFolderPathA
)(
HWND
hwnd
,
int
nFolder
,
HANDLE
hToken
,
DWORD
dwFlags
,
LPSTR
pszPath
);
static
const
char
*
inf
=
"[Version]
\n
"
"Signature=
\"
$Chicago$
\"\n
"
"[DefaultInstall]
\n
"
"ProfileItems=TestItem,TestItem2
\n
"
"[TestItem]
\n
"
"Name=TestItem
\n
"
"CmdLine=11,,notepad.exe
\n
"
"[TestItem2]
\n
"
"Name=TestItem2
\n
"
"CmdLine=11,,notepad.exe
\n
"
"SubDir=TestDir
\n
"
;
hShell32
=
LoadLibraryA
(
"shell32"
);
pSHGetFolderPathA
=
(
void
*
)
GetProcAddress
(
hShell32
,
"SHGetFolderPathA"
);
if
(
!
pSHGetFolderPathA
)
{
skip
(
"SHGetFolderPathA is not available
\n
"
);
goto
cleanup
;
}
if
(
S_OK
!=
pSHGetFolderPathA
(
NULL
,
CSIDL_COMMON_PROGRAMS
,
NULL
,
SHGFP_TYPE_CURRENT
,
commonprogs
))
{
skip
(
"No common program files directory exists
\n
"
);
goto
cleanup
;
}
create_inf_file
(
inffile
,
inf
);
sprintf
(
path
,
"%s
\\
%s"
,
CURR_DIR
,
inffile
);
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestItem.lnk"
,
commonprogs
);
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributes
(
path
))
{
todo_wine
win_skip
(
"ProfileItems not implemented on this system
\n
"
);
}
else
{
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir"
,
commonprogs
);
todo_wine
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
(
path
),
"directory not created
\n
"
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir
\\
TestItem2.lnk"
,
commonprogs
);
todo_wine
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
(
path
),
"link not created
\n
"
);
}
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestItem.lnk"
,
commonprogs
);
DeleteFile
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir
\\
TestItem2.lnk"
,
commonprogs
);
DeleteFile
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestItem2.lnk"
,
commonprogs
);
DeleteFile
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir"
,
commonprogs
);
RemoveDirectory
(
path
);
cleanup:
if
(
hShell32
)
FreeLibrary
(
hShell32
);
DeleteFile
(
inffile
);
}
START_TEST
(
install
)
{
HMODULE
hsetupapi
=
GetModuleHandle
(
"setupapi.dll"
);
...
...
@@ -429,6 +495,10 @@ START_TEST(install)
test_driver_install
();
UnhookWindowsHookEx
(
hhook
);
/* We have to run this test after the CBT hook is disabled because
ProfileItems needs to create a window on Windows XP. */
test_profile_items
();
}
SetCurrentDirectory
(
prev_path
);
...
...
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