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
83d24a64
Commit
83d24a64
authored
Aug 26, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Aug 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Move the opening of the AppId key for a clsid to a helper function.
parent
619ba90d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
15 deletions
+40
-15
compobj.c
dlls/ole32/compobj.c
+37
-0
compobj_private.h
dlls/ole32/compobj_private.h
+1
-0
rpc.c
dlls/ole32/rpc.c
+2
-15
No files found.
dlls/ole32/compobj.c
View file @
83d24a64
...
...
@@ -1108,6 +1108,43 @@ HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY
return
S_OK
;
}
/* open HKCR\\AppId\\{string form of appid clsid} key */
HRESULT
COM_OpenKeyForAppIdFromCLSID
(
REFCLSID
clsid
,
REGSAM
access
,
HKEY
*
subkey
)
{
static
const
WCHAR
szAppId
[]
=
{
'A'
,
'p'
,
'p'
,
'I'
,
'd'
,
0
};
static
const
WCHAR
szAppIdKey
[]
=
{
'A'
,
'p'
,
'p'
,
'I'
,
'd'
,
'\\'
,
0
};
DWORD
res
;
WCHAR
buf
[
CHARS_IN_GUID
];
WCHAR
keyname
[
ARRAYSIZE
(
szAppIdKey
)
+
CHARS_IN_GUID
];
DWORD
size
;
HKEY
hkey
;
DWORD
type
;
HRESULT
hr
;
/* read the AppID value under the class's key */
hr
=
COM_OpenKeyForCLSID
(
clsid
,
szAppId
,
KEY_READ
,
&
hkey
);
if
(
FAILED
(
hr
))
return
hr
;
size
=
sizeof
(
buf
);
res
=
RegQueryValueExW
(
hkey
,
NULL
,
NULL
,
&
type
,
(
LPBYTE
)
buf
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
==
ERROR_FILE_NOT_FOUND
)
return
REGDB_E_KEYMISSING
;
else
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
return
REGDB_E_READREGDB
;
strcpyW
(
keyname
,
szAppIdKey
);
strcatW
(
keyname
,
buf
);
res
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
keyname
,
0
,
access
,
subkey
);
if
(
res
==
ERROR_FILE_NOT_FOUND
)
return
REGDB_E_KEYMISSING
;
else
if
(
res
!=
ERROR_SUCCESS
)
return
REGDB_E_READREGDB
;
return
S_OK
;
}
/******************************************************************************
* ProgIDFromCLSID [OLE32.@]
*
...
...
dlls/ole32/compobj_private.h
View file @
83d24a64
...
...
@@ -178,6 +178,7 @@ extern void* StdGlobalInterfaceTableInstance;
extern
HRESULT
WINE_StringFromCLSID
(
const
CLSID
*
id
,
LPSTR
idstr
);
HRESULT
COM_OpenKeyForCLSID
(
REFCLSID
clsid
,
LPCWSTR
keyname
,
REGSAM
access
,
HKEY
*
key
);
HRESULT
COM_OpenKeyForAppIdFromCLSID
(
REFCLSID
clsid
,
REGSAM
access
,
HKEY
*
subkey
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
HRESULT
FTMarshalCF_Create
(
REFIID
riid
,
LPVOID
*
ppv
);
...
...
dlls/ole32/rpc.c
View file @
83d24a64
...
...
@@ -796,9 +796,7 @@ static DWORD start_local_service(LPCWSTR name, DWORD num, LPCWSTR *params)
static
HRESULT
create_local_service
(
REFCLSID
rclsid
)
{
HRESULT
hres
;
WCHAR
buf
[
CHARS_IN_GUID
],
keyname
[
50
];
static
const
WCHAR
szAppId
[]
=
{
'A'
,
'p'
,
'p'
,
'I'
,
'd'
,
0
};
static
const
WCHAR
szAppIdKey
[]
=
{
'A'
,
'p'
,
'p'
,
'I'
,
'd'
,
'\\'
,
0
};
WCHAR
buf
[
CHARS_IN_GUID
];
static
const
WCHAR
szLocalService
[]
=
{
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
szServiceParams
[]
=
{
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'P'
,
'a'
,
'r'
,
'a'
,
'm'
,
's'
,
0
};
HKEY
hkey
;
...
...
@@ -807,22 +805,11 @@ static HRESULT create_local_service(REFCLSID rclsid)
TRACE
(
"Attempting to start Local service for %s
\n
"
,
debugstr_guid
(
rclsid
));
/* read the AppID value under the class's key */
hres
=
COM_OpenKeyForCLSID
(
rclsid
,
szAppId
,
KEY_READ
,
&
hkey
);
hres
=
COM_OpenKeyForAppIdFromCLSID
(
rclsid
,
KEY_READ
,
&
hkey
);
if
(
FAILED
(
hres
))
return
hres
;
sz
=
sizeof
buf
;
r
=
RegQueryValueExW
(
hkey
,
NULL
,
NULL
,
&
type
,
(
LPBYTE
)
buf
,
&
sz
);
RegCloseKey
(
hkey
);
if
(
r
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
return
hres
;
/* read the LocalService and ServiceParameters values from the AppID key */
strcpyW
(
keyname
,
szAppIdKey
);
strcatW
(
keyname
,
buf
);
r
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
keyname
,
0
,
KEY_READ
,
&
hkey
);
if
(
r
!=
ERROR_SUCCESS
)
return
hres
;
sz
=
sizeof
buf
;
r
=
RegQueryValueExW
(
hkey
,
szLocalService
,
NULL
,
&
type
,
(
LPBYTE
)
buf
,
&
sz
);
if
(
r
==
ERROR_SUCCESS
&&
type
==
REG_SZ
)
...
...
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