Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f8134cee
Commit
f8134cee
authored
Nov 26, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Nov 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Cope with systems lacking SHGetSpecialFolderPath.
parent
d5dac6c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
18 deletions
+35
-18
progman_dde.c
dlls/shell32/tests/progman_dde.c
+35
-18
No files found.
dlls/shell32/tests/progman_dde.c
View file @
f8134cee
...
...
@@ -89,23 +89,47 @@ static void init_strings(void)
{
HKEY
key
;
DWORD
fullpath
=
0
;
DWORD
size
=
sizeof
(
DWORD
)
;
DWORD
size
;
char
startup
[
MAX_PATH
];
if
(
!
pSHGetSpecialFolderPathA
)
return
;
/* FIXME: On Vista+ we should only use CSIDL_PROGRAMS */
pSHGetSpecialFolderPathA
(
NULL
,
Programs
,
CSIDL_PROGRAMS
,
FALSE
);
if
(
!
pSHGetSpecialFolderPathA
(
NULL
,
CommonPrograms
,
CSIDL_COMMON_PROGRAMS
,
FALSE
))
if
(
pSHGetSpecialFolderPathA
)
{
/* Win9x */
lstrcpyA
(
CommonPrograms
,
Programs
);
/* FIXME: On Vista+ we should only use CSIDL_PROGRAMS */
pSHGetSpecialFolderPathA
(
NULL
,
Programs
,
CSIDL_PROGRAMS
,
FALSE
);
if
(
!
pSHGetSpecialFolderPathA
(
NULL
,
CommonPrograms
,
CSIDL_COMMON_PROGRAMS
,
FALSE
))
{
/* Win9x */
lstrcpyA
(
CommonPrograms
,
Programs
);
}
pSHGetSpecialFolderPathA
(
NULL
,
startup
,
CSIDL_STARTUP
,
FALSE
);
lstrcpyA
(
Startup
,
(
strrchr
(
startup
,
'\\'
)
+
1
));
}
else
{
LONG
res
;
/* Older Win9x and NT4 */
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
Shell Folders"
,
&
key
);
size
=
sizeof
(
CommonPrograms
);
res
=
RegQueryValueExA
(
key
,
"Common Programs"
,
NULL
,
NULL
,
(
LPBYTE
)
&
CommonPrograms
,
&
size
);
RegCloseKey
(
key
);
if
(
res
!=
ERROR_SUCCESS
)
{
/* Win9x */
lstrcpyA
(
CommonPrograms
,
Programs
);
}
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
Shell Folders"
,
&
key
);
size
=
sizeof
(
Programs
);
RegQueryValueExA
(
key
,
"Programs"
,
NULL
,
NULL
,
(
LPBYTE
)
&
Programs
,
&
size
);
size
=
sizeof
(
startup
);
RegQueryValueExA
(
key
,
"Startup"
,
NULL
,
NULL
,
(
LPBYTE
)
&
startup
,
&
size
);
lstrcpyA
(
Startup
,
(
strrchr
(
startup
,
'\\'
)
+
1
));
RegCloseKey
(
key
);
}
pSHGetSpecialFolderPathA
(
NULL
,
startup
,
CSIDL_STARTUP
,
FALSE
);
lstrcpyA
(
Startup
,
(
strrchr
(
startup
,
'\\'
)
+
1
));
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
CabinetState"
,
&
key
);
size
=
sizeof
(
DWORD
);
RegQueryValueExA
(
key
,
"FullPath"
,
NULL
,
NULL
,
(
LPBYTE
)
&
fullpath
,
&
size
);
RegCloseKey
(
key
);
if
(
fullpath
==
1
)
...
...
@@ -291,9 +315,6 @@ static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldEx
DWORD
attributes
;
int
len
;
if
(
!
pSHGetSpecialFolderPathA
)
return
;
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_PATH
);
if
(
path
!=
NULL
)
{
...
...
@@ -580,10 +601,6 @@ START_TEST(progman_dde)
init_function_pointers
();
init_strings
();
/* Only report this once */
if
(
!
pSHGetSpecialFolderPathA
)
win_skip
(
"SHGetSpecialFolderPathA is not available
\n
"
);
/* Initialize DDE Instance */
err
=
DdeInitialize
(
&
instance
,
DdeCallback
,
APPCMD_CLIENTONLY
,
0
);
ok
(
err
==
DMLERR_NO_ERROR
,
"DdeInitialize Error %s
\n
"
,
GetStringFromError
(
err
));
...
...
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