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
7b6dd2c9
Commit
7b6dd2c9
authored
Mar 11, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Get rid of WINE_StringFromCLSID and A->W conversions.
parent
6b40f64e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
53 deletions
+13
-53
compobj.c
dlls/ole32/compobj.c
+13
-50
compobj_private.h
dlls/ole32/compobj_private.h
+0
-3
No files found.
dlls/ole32/compobj.c
View file @
7b6dd2c9
...
@@ -1429,40 +1429,6 @@ HRESULT WINAPI CLSIDFromString(LPOLESTR idstr, CLSID *id )
...
@@ -1429,40 +1429,6 @@ HRESULT WINAPI CLSIDFromString(LPOLESTR idstr, CLSID *id )
return
ret
;
return
ret
;
}
}
/* Converts a GUID into the respective string representation. */
HRESULT
WINE_StringFromCLSID
(
const
CLSID
*
id
,
/* [in] GUID to be converted */
LPSTR
idstr
/* [out] pointer to buffer to contain converted guid */
)
{
static
const
char
hex
[]
=
"0123456789ABCDEF"
;
char
*
s
;
int
i
;
if
(
!
id
)
{
ERR
(
"called with id=Null
\n
"
);
*
idstr
=
0x00
;
return
E_FAIL
;
}
sprintf
(
idstr
,
"{%08X-%04X-%04X-%02X%02X-"
,
id
->
Data1
,
id
->
Data2
,
id
->
Data3
,
id
->
Data4
[
0
],
id
->
Data4
[
1
]);
s
=
&
idstr
[
25
];
/* 6 hex bytes */
for
(
i
=
2
;
i
<
8
;
i
++
)
{
*
s
++
=
hex
[
id
->
Data4
[
i
]
>>
4
];
*
s
++
=
hex
[
id
->
Data4
[
i
]
&
0xf
];
}
*
s
++
=
'}'
;
*
s
++
=
'\0'
;
TRACE
(
"%p->%s
\n
"
,
id
,
idstr
);
return
S_OK
;
}
/******************************************************************************
/******************************************************************************
* StringFromCLSID [OLE32.@]
* StringFromCLSID [OLE32.@]
...
@@ -1484,20 +1450,13 @@ HRESULT WINE_StringFromCLSID(
...
@@ -1484,20 +1450,13 @@ HRESULT WINE_StringFromCLSID(
*/
*/
HRESULT
WINAPI
StringFromCLSID
(
REFCLSID
id
,
LPOLESTR
*
idstr
)
HRESULT
WINAPI
StringFromCLSID
(
REFCLSID
id
,
LPOLESTR
*
idstr
)
{
{
char
buf
[
80
];
HRESULT
ret
;
HRESULT
ret
;
LPMALLOC
mllc
;
LPMALLOC
mllc
;
if
((
ret
=
CoGetMalloc
(
0
,
&
mllc
)))
if
((
ret
=
CoGetMalloc
(
0
,
&
mllc
)))
return
ret
;
return
ret
;
if
(
!
(
*
idstr
=
IMalloc_Alloc
(
mllc
,
CHARS_IN_GUID
*
sizeof
(
WCHAR
)
)))
return
E_OUTOFMEMORY
;
StringFromGUID2
(
id
,
*
idstr
,
CHARS_IN_GUID
);
ret
=
WINE_StringFromCLSID
(
id
,
buf
);
return
S_OK
;
if
(
ret
==
S_OK
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
buf
,
-
1
,
NULL
,
0
);
*
idstr
=
IMalloc_Alloc
(
mllc
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
buf
,
-
1
,
*
idstr
,
len
);
}
return
ret
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -1517,11 +1476,15 @@ HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
...
@@ -1517,11 +1476,15 @@ HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
*/
*/
INT
WINAPI
StringFromGUID2
(
REFGUID
id
,
LPOLESTR
str
,
INT
cmax
)
INT
WINAPI
StringFromGUID2
(
REFGUID
id
,
LPOLESTR
str
,
INT
cmax
)
{
{
char
xguid
[
80
];
static
const
WCHAR
formatW
[]
=
{
'{'
,
'%'
,
'0'
,
'8'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'-'
,
if
(
WINE_StringFromCLSID
(
id
,
xguid
))
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
return
0
;
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'}'
,
0
};
return
MultiByteToWideChar
(
CP_ACP
,
0
,
xguid
,
-
1
,
str
,
cmax
);
if
(
cmax
<
CHARS_IN_GUID
)
return
0
;
sprintfW
(
str
,
formatW
,
id
->
Data1
,
id
->
Data2
,
id
->
Data3
,
id
->
Data4
[
0
],
id
->
Data4
[
1
],
id
->
Data4
[
2
],
id
->
Data4
[
3
],
id
->
Data4
[
4
],
id
->
Data4
[
5
],
id
->
Data4
[
6
],
id
->
Data4
[
7
]
);
return
CHARS_IN_GUID
;
}
}
/* open HKCR\\CLSID\\{string form of clsid}\\{keyname} key */
/* open HKCR\\CLSID\\{string form of clsid}\\{keyname} key */
...
...
dlls/ole32/compobj_private.h
View file @
7b6dd2c9
...
@@ -196,9 +196,6 @@ extern void* StdGlobalInterfaceTable_Construct(void);
...
@@ -196,9 +196,6 @@ extern void* StdGlobalInterfaceTable_Construct(void);
extern
HRESULT
StdGlobalInterfaceTable_GetFactory
(
LPVOID
*
ppv
);
extern
HRESULT
StdGlobalInterfaceTable_GetFactory
(
LPVOID
*
ppv
);
extern
void
*
StdGlobalInterfaceTableInstance
;
extern
void
*
StdGlobalInterfaceTableInstance
;
/* FIXME: these shouldn't be needed, except for 16-bit functions */
extern
HRESULT
WINE_StringFromCLSID
(
const
CLSID
*
id
,
LPSTR
idstr
);
HRESULT
COM_OpenKeyForCLSID
(
REFCLSID
clsid
,
LPCWSTR
keyname
,
REGSAM
access
,
HKEY
*
key
);
HRESULT
COM_OpenKeyForCLSID
(
REFCLSID
clsid
,
LPCWSTR
keyname
,
REGSAM
access
,
HKEY
*
key
);
HRESULT
COM_OpenKeyForAppIdFromCLSID
(
REFCLSID
clsid
,
REGSAM
access
,
HKEY
*
subkey
);
HRESULT
COM_OpenKeyForAppIdFromCLSID
(
REFCLSID
clsid
,
REGSAM
access
,
HKEY
*
subkey
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
...
...
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