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
22699818
Commit
22699818
authored
Jan 18, 2010
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Jan 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sti: Add launch application registry.
parent
ac1ad137
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
4 deletions
+87
-4
sti.c
dlls/sti/sti.c
+58
-4
sti.c
dlls/sti/tests/sti.c
+29
-0
No files found.
dlls/sti/sti.c
View file @
22699818
...
...
@@ -31,9 +31,19 @@
#include "sti_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
sti
);
static
const
WCHAR
registeredAppsLaunchPath
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'S'
,
't'
,
'i'
,
'l'
,
'l'
,
'I'
,
'm'
,
'a'
,
'g'
,
'e'
,
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'e'
,
'r'
,
'e'
,
'd'
,
' '
,
'A'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
's'
,
0
};
static
inline
stillimage
*
impl_from_StillImageW
(
IStillImageW
*
iface
)
{
return
(
stillimage
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
stillimage
,
lpVtbl
));
...
...
@@ -119,16 +129,60 @@ static HRESULT WINAPI stillimagew_GetSTILaunchInformation(IStillImageW *iface, L
static
HRESULT
WINAPI
stillimagew_RegisterLaunchApplication
(
IStillImageW
*
iface
,
LPWSTR
pwszAppName
,
LPWSTR
pwszCommandLine
)
{
static
const
WCHAR
format
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
's'
,
0
};
static
const
WCHAR
commandLineSuffix
[]
=
{
'/'
,
'S'
,
't'
,
'i'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
':'
,
'%'
,
'1'
,
' '
,
'/'
,
'S'
,
't'
,
'i'
,
'E'
,
'v'
,
'e'
,
'n'
,
't'
,
':'
,
'%'
,
'2'
,
0
};
HKEY
registeredAppsKey
=
NULL
;
DWORD
ret
;
HRESULT
hr
=
S_OK
;
stillimage
*
This
=
impl_from_StillImageW
(
iface
);
FIXME
(
"(%p, %s, %s): stub
\n
"
,
This
,
debugstr_w
(
pwszAppName
),
debugstr_w
(
pwszCommandLine
));
return
E_NOTIMPL
;
TRACE
(
"(%p, %s, %s)
\n
"
,
This
,
debugstr_w
(
pwszAppName
),
debugstr_w
(
pwszCommandLine
));
ret
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
registeredAppsLaunchPath
,
&
registeredAppsKey
);
if
(
ret
==
ERROR_SUCCESS
)
{
WCHAR
*
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwszCommandLine
)
+
1
+
lstrlenW
(
commandLineSuffix
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
value
)
{
sprintfW
(
value
,
format
,
pwszCommandLine
,
commandLineSuffix
);
ret
=
RegSetValueExW
(
registeredAppsKey
,
pwszAppName
,
0
,
REG_SZ
,
(
BYTE
*
)
value
,
(
lstrlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
ret
!=
ERROR_SUCCESS
)
hr
=
HRESULT_FROM_WIN32
(
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
value
);
}
else
hr
=
E_OUTOFMEMORY
;
RegCloseKey
(
registeredAppsKey
);
}
else
hr
=
HRESULT_FROM_WIN32
(
ret
);
return
hr
;
}
static
HRESULT
WINAPI
stillimagew_UnregisterLaunchApplication
(
IStillImageW
*
iface
,
LPWSTR
pwszAppName
)
{
stillimage
*
This
=
impl_from_StillImageW
(
iface
);
FIXME
(
"(%p, %s): stub
\n
"
,
This
,
debugstr_w
(
pwszAppName
));
return
S_OK
;
HKEY
registeredAppsKey
=
NULL
;
DWORD
ret
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p, %s)
\n
"
,
This
,
debugstr_w
(
pwszAppName
));
ret
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
registeredAppsLaunchPath
,
&
registeredAppsKey
);
if
(
ret
==
ERROR_SUCCESS
)
{
ret
=
RegDeleteValueW
(
registeredAppsKey
,
pwszAppName
);
if
(
ret
!=
ERROR_SUCCESS
)
hr
=
HRESULT_FROM_WIN32
(
ret
);
RegCloseKey
(
registeredAppsKey
);
}
else
hr
=
HRESULT_FROM_WIN32
(
ret
);
return
hr
;
}
static
HRESULT
WINAPI
stillimagew_EnableHwNotifications
(
IStillImageW
*
iface
,
LPCWSTR
pwszDeviceName
,
...
...
dlls/sti/tests/sti.c
View file @
22699818
...
...
@@ -228,6 +228,34 @@ static void test_stillimage_aggregation(void)
skip
(
"No StiCreateInstanceW function
\n
"
);
}
static
void
test_launch_app_registry
(
void
)
{
static
WCHAR
appName
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
's'
,
't'
,
'i'
,
't'
,
'e'
,
's'
,
't'
,
'a'
,
'p'
,
'p'
,
0
};
IStillImageW
*
pStiW
=
NULL
;
HRESULT
hr
;
if
(
pStiCreateInstanceW
==
NULL
)
{
win_skip
(
"No StiCreateInstanceW function
\n
"
);
return
;
}
hr
=
pStiCreateInstance
(
GetModuleHandle
(
NULL
),
STI_VERSION_REAL
|
STI_VERSION_FLAG_UNICODE
,
&
pStiW
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IStillImage_RegisterLaunchApplication
(
pStiW
,
appName
,
appName
);
ok
(
SUCCEEDED
(
hr
),
"could not register launch application, error 0x%X
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IStillImage_UnregisterLaunchApplication
(
pStiW
,
appName
);
ok
(
SUCCEEDED
(
hr
),
"could not unregister launch application, error 0x%X
\n
"
,
hr
);
}
IStillImage_Release
(
pStiW
);
}
else
ok
(
0
,
"could not create StillImageW, hr = 0x%X
\n
"
,
hr
);
}
START_TEST
(
sti
)
{
if
(
SUCCEEDED
(
CoInitialize
(
NULL
)))
...
...
@@ -236,6 +264,7 @@ START_TEST(sti)
{
test_version_flag_versus_aw
();
test_stillimage_aggregation
();
test_launch_app_registry
();
FreeLibrary
(
sti_dll
);
}
else
...
...
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