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
9be7f278
Commit
9be7f278
authored
Mar 29, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Mar 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WriteFmtUserTypeStg doesn't pull a CLSID from the registry - it's
unclear when (if at all) this gets written.
parent
89b0f3ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
81 deletions
+11
-81
storage32.c
dlls/ole32/storage32.c
+11
-81
No files found.
dlls/ole32/storage32.c
View file @
9be7f278
...
...
@@ -6776,61 +6776,6 @@ static HRESULT STORAGE_WriteCompObj( LPSTORAGE pstg, CLSID *clsid,
return
r
;
}
/* enumerate HKEY_CLASSES_ROOT\\CLSID looking for a CLSID whose name matches */
static
HRESULT
CLSIDFromUserType
(
LPCWSTR
lpszUserType
,
CLSID
*
clsid
)
{
LONG
r
,
i
,
len
;
ULONG
count
;
WCHAR
szKey
[
0x40
];
HKEY
hkey
,
hkeyclsid
;
LPWSTR
buffer
=
NULL
;
BOOL
found
=
FALSE
;
static
const
WCHAR
szclsid
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
TRACE
(
"Finding CLSID for %s
\n
"
,
debugstr_w
(
lpszUserType
));
r
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
szclsid
,
&
hkeyclsid
);
if
(
r
)
return
E_INVALIDARG
;
len
=
lstrlenW
(
lpszUserType
)
+
1
;
buffer
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
)
);
if
(
!
buffer
)
goto
end
;
for
(
i
=
0
;
!
found
;
i
++
)
{
r
=
RegEnumKeyW
(
hkeyclsid
,
i
,
szKey
,
sizeof
(
szKey
)
/
sizeof
(
WCHAR
));
if
(
r
!=
ERROR_SUCCESS
)
break
;
hkey
=
0
;
r
=
RegOpenKeyW
(
hkeyclsid
,
szKey
,
&
hkey
);
if
(
r
!=
ERROR_SUCCESS
)
break
;
count
=
len
*
sizeof
(
WCHAR
);
r
=
RegQueryValueW
(
hkey
,
NULL
,
buffer
,
&
count
);
found
=
(
r
==
ERROR_SUCCESS
)
&&
(
count
==
len
*
sizeof
(
WCHAR
)
)
&&
!
lstrcmpW
(
buffer
,
lpszUserType
)
;
RegCloseKey
(
hkey
);
}
end
:
if
(
buffer
)
CoTaskMemFree
(
buffer
);
RegCloseKey
(
hkeyclsid
);
if
(
!
found
)
return
E_INVALIDARG
;
TRACE
(
"clsid is %s
\n
"
,
debugstr_w
(
szKey
)
);
r
=
CLSIDFromString
(
szKey
,
clsid
);
return
r
;
}
/***********************************************************************
* WriteFmtUserTypeStg (OLE32.@)
*/
...
...
@@ -6839,47 +6784,32 @@ HRESULT WINAPI WriteFmtUserTypeStg(
{
HRESULT
r
;
WCHAR
szwClipName
[
0x40
];
WCHAR
szCLSIDName
[
OLESTREAM_MAX_STR_LEN
];
CLSID
clsid
;
LPWSTR
wstrProgID
;
CLSID
clsid
=
CLSID_NULL
;
LPWSTR
wstrProgID
=
NULL
;
DWORD
n
;
LPMALLOC
allocator
=
NULL
;
TRACE
(
"(%p,%x,%s)
\n
"
,
pstg
,
cf
,
debugstr_w
(
lpszUserType
));
r
=
CoGetMalloc
(
0
,
&
allocator
);
if
(
FAILED
(
r
)
)
return
E_OUTOFMEMORY
;
/* get the clipboard format name */
n
=
GetClipboardFormatNameW
(
cf
,
szwClipName
,
sizeof
(
szwClipName
)
);
szwClipName
[
n
]
=
0
;
TRACE
(
"Clipboard name is %s
\n
"
,
debugstr_w
(
szwClipName
));
/* Get the CLSID */
szCLSIDName
[
0
]
=
0
;
r
=
CLSIDFromUserType
(
lpszUserType
,
&
clsid
);
if
(
FAILED
(
r
)
)
return
r
;
TRACE
(
"CLSID is %s
\n
"
,
debugstr_guid
(
&
clsid
));
/* FIXME: There's room to save a CLSID and its ProgID, but
the CLSID is not looked up in the registry and in all the
tests I wrote it was CLSID_NULL. Where does it come from?
*/
/* get the real program ID */
r
=
ProgIDFromCLSID
(
&
clsid
,
&
wstrProgID
);
if
(
FAILED
(
r
)
)
return
r
;
/* get the real program ID. This may fail, but that's fine */
ProgIDFromCLSID
(
&
clsid
,
&
wstrProgID
);
TRACE
(
"progid is %s
\n
"
,
debugstr_w
(
wstrProgID
));
/* if we have a good string, write the stream */
if
(
wstrProgID
)
r
=
STORAGE_WriteCompObj
(
pstg
,
&
clsid
,
lpszUserType
,
szwClipName
,
wstrProgID
);
else
r
=
E_OUTOFMEMORY
;
r
=
STORAGE_WriteCompObj
(
pstg
,
&
clsid
,
lpszUserType
,
szwClipName
,
wstrProgID
);
IMalloc_Free
(
allocator
,
wstrProgID
);
CoTaskMemFree
(
wstrProgID
);
return
r
;
}
...
...
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