Commit 91791032 authored by Alexandre Julliard's avatar Alexandre Julliard

Cleaned up a few inter-dll dependencies.

parent b167d4b2
......@@ -763,7 +763,7 @@ HRESULT WINAPI CLSIDFromString(
* RETURNS
* the string representation and OLESTATUS
*/
HRESULT WINE_StringFromCLSID(
static HRESULT WINE_StringFromCLSID(
const CLSID *id, /* [in] GUID to be converted */
LPSTR idstr /* [out] pointer to buffer to contain converted guid */
) {
......
......@@ -35,7 +35,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "crtdll.h"
#include "wine/obj_oleview.h"
#include "wine/obj_cache.h"
#include "wine/unicode.h"
......@@ -683,9 +682,9 @@ static BOOL DataCache_IsPresentationStream(const STATSTG *elem)
&& (elem->cbSize.s.LowPart >= sizeof(PresentationDataHeader))
&& (strlenW(name) == 11)
&& (strncmpW(name, OlePres, 8) == 0)
&& CRTDLL_iswdigit(name[8])
&& CRTDLL_iswdigit(name[9])
&& CRTDLL_iswdigit(name[10]);
&& (name[8] >= '0') && (name[8] <= '9')
&& (name[9] >= '0') && (name[9] <= '9')
&& (name[10] >= '0') && (name[10] <= '9');
}
/************************************************************************
......
......@@ -393,7 +393,6 @@ HRESULT WINAPI OleRegGetUserType(
DWORD dwFormOfType,
LPOLESTR* pszUserType)
{
char xclsid[50];
char keyName[60];
DWORD dwKeyType;
DWORD cbData;
......@@ -409,11 +408,10 @@ HRESULT WINAPI OleRegGetUserType(
/*
* Build the key name we're looking for
*/
WINE_StringFromCLSID((LPCLSID)clsid, xclsid);
strcpy(keyName, "CLSID\\");
strcat(keyName, xclsid);
strcat(keyName, "\\");
sprintf( keyName, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\",
clsid->Data1, clsid->Data2, clsid->Data3,
clsid->Data4[0], clsid->Data4[1], clsid->Data4[2], clsid->Data4[3],
clsid->Data4[4], clsid->Data4[5], clsid->Data4[6], clsid->Data4[7] );
TRACE("(%s, %ld, %p)\n", keyName, dwFormOfType, pszUserType);
......@@ -602,7 +600,6 @@ HRESULT WINAPI OleRegGetMiscStatus(
DWORD dwAspect,
DWORD* pdwStatus)
{
char xclsid[50];
char keyName[60];
HKEY clsidKey;
HKEY miscStatusKey;
......@@ -617,11 +614,10 @@ HRESULT WINAPI OleRegGetMiscStatus(
/*
* Build the key name we're looking for
*/
WINE_StringFromCLSID((LPCLSID)clsid, xclsid);
strcpy(keyName, "CLSID\\");
strcat(keyName, xclsid);
strcat(keyName, "\\");
sprintf( keyName, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\",
clsid->Data1, clsid->Data2, clsid->Data3,
clsid->Data4[0], clsid->Data4[1], clsid->Data4[2], clsid->Data4[3],
clsid->Data4[4], clsid->Data4[5], clsid->Data4[6], clsid->Data4[7] );
TRACE("(%s, %ld, %p)\n", keyName, dwAspect, pdwStatus);
......
......@@ -73,10 +73,11 @@ QueryPathOfRegTypeLib16(
DWORD plen;
if (HIWORD(guid)) {
WINE_StringFromCLSID(guid,xguid);
sprintf(typelibkey,"SOFTWARE\\Classes\\Typelib\\%s\\%d.%d\\%lx\\win16",
xguid,wMaj,wMin,lcid
);
sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%lx\\win16",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7],
wMaj,wMin,lcid);
} else {
sprintf(xguid,"<guid 0x%08lx>",(DWORD)guid);
FIXME("(%s,%d,%d,0x%04lx,%p),can't handle non-string guids.\n",xguid,wMaj,wMin,(DWORD)lcid,path);
......@@ -113,10 +114,11 @@ QueryPathOfRegTypeLib(
if (HIWORD(guid)) {
WINE_StringFromCLSID(guid,xguid);
sprintf(typelibkey,"SOFTWARE\\Classes\\Typelib\\%s\\%d.%d\\%lx\\win32",
xguid,wMaj,wMin,lcid
);
sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%lx\\win32",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7],
wMaj,wMin,lcid);
} else {
sprintf(xguid,"<guid 0x%08lx>",(DWORD)guid);
FIXME("(%s,%d,%d,0x%04lx,%p),stub!\n",xguid,wMaj,wMin,(DWORD)lcid,path);
......@@ -222,12 +224,8 @@ HRESULT WINAPI LoadRegTypeLib(
res= LoadTypeLib(bstr, ppTLib);
SysFreeString(bstr);
}
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)rguid,xriid);
TRACE("(IID: %s) load %s (%p)\n",xriid,
TRACE("(IID: %s) load %s (%p)\n",debugstr_guid(rguid),
SUCCEEDED(res)? "SUCCESS":"FAILED", *ppTLib);
}
return res;
}
......@@ -270,9 +268,7 @@ HRESULT WINAPI UnRegisterTypeLib(
LCID lcid, /* [in] locale id */
SYSKIND syskind)
{
char xriid[50];
WINE_StringFromCLSID((LPCLSID)libid,xriid);
TRACE("(IID: %s): stub\n",xriid);
TRACE("(IID: %s): stub\n",debugstr_guid(libid));
return S_OK; /* FIXME: pretend everything is OK */
}
......@@ -1260,11 +1256,7 @@ int TLB_ReadTypeLib(PCHAR file, ITypeLib **ppTypeLib)
static HRESULT WINAPI ITypeLib_fnQueryInterface( LPTYPELIB This, REFIID riid,
VOID **ppvObject)
{
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE("(%p)->(IID: %s)\n",This,xriid);
}
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
*ppvObject=NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid,&IID_ITypeLib)||
......@@ -1364,11 +1356,7 @@ static HRESULT WINAPI ITypeLib_fnGetTypeInfoOfGuid( LPTYPELIB iface,
int i;
ICOM_THIS( TLBLibInfo, iface);
TLBTypeInfo **ppTLBTInfo=(TLBTypeInfo **)ppTInfo;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %sx)\n",This,xriid);
}
TRACE("(%p) guid %sx)\n",This,debugstr_guid(guid));
for(i=0,*ppTLBTInfo=This->pTypeInfo;*ppTLBTInfo &&
!IsEqualIID(guid,&(*ppTLBTInfo)->TypeAttr.guid);i++)
*ppTLBTInfo=(*ppTLBTInfo)->next;
......@@ -1551,11 +1539,7 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData( ITypeLib * iface, REFGUID guid,
TLBCustData *pCData;
for(pCData=This->pCustData; pCData; pCData = pCData->next)
if( IsEqualIID(guid, &pCData->guid)) break;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %s %s found!x)\n", This, xriid, pCData? "" : "NOT");
}
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
if(pCData){
VariantInit( pVarVal);
VariantCopy( pVarVal, &pCData->data);
......@@ -1655,11 +1639,7 @@ static HRESULT WINAPI ITypeInfo_fnQueryInterface( LPTYPEINFO iface, REFIID riid,
VOID **ppvObject)
{
ICOM_THIS( TLBTypeInfo, iface);
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE("(%p)->(IID: %s)\n",This,xriid);
}
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
*ppvObject=NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid,&IID_ITypeInfo)||
......@@ -2243,11 +2223,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetCustData( ITypeInfo * iface,
TLBCustData *pCData;
for(pCData=This->pCustData; pCData; pCData = pCData->next)
if( IsEqualIID(guid, &pCData->guid)) break;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %s %s found!x)\n", This, xriid, pCData? "" : "NOT");
}
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
if(pCData){
VariantInit( pVarVal);
VariantCopy( pVarVal, &pCData->data);
......@@ -2273,11 +2249,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData( ITypeInfo * iface,
if(pFDesc)
for(pCData=pFDesc->pCustData; pCData; pCData = pCData->next)
if( IsEqualIID(guid, &pCData->guid)) break;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %s %s found!x)\n", This, xriid, pCData? "" : "NOT");
}
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
if(pCData){
VariantInit( pVarVal);
VariantCopy( pVarVal, &pCData->data);
......@@ -2304,11 +2276,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetParamCustData( ITypeInfo * iface,
for(pCData=pFDesc->pParamDesc[indexParam].pCustData; pCData;
pCData = pCData->next)
if( IsEqualIID(guid, &pCData->guid)) break;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %s %s found!x)\n", This, xriid, pCData? "" : "NOT");
}
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
if(pCData){
VariantInit( pVarVal);
VariantCopy( pVarVal, &pCData->data);
......@@ -2334,11 +2302,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData( ITypeInfo * iface,
if(pVDesc)
for(pCData=pVDesc->pCustData; pCData; pCData = pCData->next)
if( IsEqualIID(guid, &pCData->guid)) break;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %s %s found!x)\n", This, xriid, pCData? "" : "NOT");
}
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
if(pCData){
VariantInit( pVarVal);
VariantCopy( pVarVal, &pCData->data);
......@@ -2364,11 +2328,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData( ITypeInfo * iface,
if(pRDesc)
for(pCData=pRDesc->pCustData; pCData; pCData = pCData->next)
if( IsEqualIID(guid, &pCData->guid)) break;
if(TRACE_ON(typelib)){
char xriid[50];
WINE_StringFromCLSID((LPCLSID)guid,xriid);
TRACE("(%p) guid %s %s found!x)\n", This, xriid, pCData? "" : "NOT");
}
TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT");
if(pCData){
VariantInit( pVarVal);
VariantCopy( pVarVal, &pCData->data);
......
......@@ -9,8 +9,8 @@
#include "windef.h"
#include "wingdi.h"
#include "wtypes.h"
#include "ldt.h"
#include "ole.h"
#include "gdi.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(ole);
......@@ -156,30 +156,21 @@ OLESTATUS WINAPI OleQueryCreateFromClip(LPCSTR name,OLEOPT_RENDER render,OLECLIP
}
/******************************************************************************
* OleIsDcMeta16 [OLECLI.60]
* OleIsDcMeta [OLECLI32.60]
*/
BOOL16 WINAPI OleIsDcMeta16(HDC16 hdc)
BOOL WINAPI OleIsDcMeta(HDC hdc)
{
TRACE("(%04x)\n",hdc);
if (GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0) {
GDI_HEAP_UNLOCK( hdc );
return TRUE;
}
return FALSE;
return GetObjectType( hdc ) == OBJ_METADC;
}
/******************************************************************************
* OleIsDcMeta [OLECLI32.60]
* OleIsDcMeta16 [OLECLI.60]
*/
BOOL WINAPI OleIsDcMeta(HDC hdc)
BOOL16 WINAPI OleIsDcMeta16(HDC16 hdc)
{
TRACE("(%04x)\n",hdc);
if (GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0) {
GDI_HEAP_UNLOCK( hdc );
return TRUE;
}
return FALSE;
return OleIsDcMeta( hdc );
}
......
......@@ -117,8 +117,10 @@ BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len)
BOOL ret = FALSE;
DWORD buflen = len;
strcpy(xriid,"CLSID\\");
WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]);
sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
TRACE("%s\n",xriid );
......@@ -165,8 +167,10 @@ BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest)
DWORD attributes;
DWORD len = 4;
strcpy(xriid,"CLSID\\");
WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]);
sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
TRACE("%s\n",xriid );
if (!szDest) return FALSE;
......
......@@ -5,6 +5,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "wine/obj_base.h"
......@@ -153,8 +154,10 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation(
else if ( (riid = _ILGetGUIDPointer(pSimplePidl)) )
{
char xriid[50];
strcpy(xriid,"CLSID\\");
WINE_StringFromCLSID((LPCLSID)riid,&xriid[strlen(xriid)]);
sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
if (HCR_GetDefaultIcon(xriid, sTemp, MAX_PATH, &dwNr))
{
......
......@@ -1210,7 +1210,11 @@ LPITEMIDLIST _ILCreateValue(WIN32_FIND_DATAA * stffile)
LPITEMIDLIST _ILCreateSpecial(LPCSTR szGUID)
{
IID iid;
CLSIDFromString16(szGUID,&iid);
WCHAR buffer[40];
if (!MultiByteToWideChar( CP_ACP, 0, szGUID, -1, buffer, sizeof(buffer)/sizeof(WCHAR) ))
return NULL;
CLSIDFromString( buffer, &iid );
return _ILCreate(PT_MYCOMP, &iid, sizeof(IID));
}
......
......@@ -122,8 +122,11 @@ HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv
*/
DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id)
{
WCHAR buffer[40];
TRACE("(%p(%s) %p)\n", clsid, clsid, id);
return CLSIDFromString16(clsid, id);
if (!MultiByteToWideChar( CP_ACP, 0, clsid, -1, buffer, sizeof(buffer)/sizeof(WCHAR) ))
return CO_E_CLASSSTRING;
return CLSIDFromString( buffer, id );
}
DWORD WINAPI SHCLSIDFromStringW (LPWSTR clsid, CLSID *id)
{
......
......@@ -1013,10 +1013,13 @@ DWORD WINAPI SHLWAPI_23 (
LPSTR str, /* [out] buffer */
INT cmax) /* [in] size of buffer */
{
char xguid[80];
TRACE("(%s %p 0x%08x)stub\n", debugstr_guid(guid), str, cmax);
char xguid[40];
if (WINE_StringFromCLSID(guid,xguid)) return 0;
sprintf( xguid, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
TRACE("(%s %p 0x%08x)stub\n", xguid, str, cmax);
if (strlen(xguid)>=cmax) return 0;
strcpy(str,xguid);
return strlen(xguid) + 1;
......@@ -1108,7 +1111,7 @@ LPWSTR WINAPI SHLWAPI_215 (
int len)
{
WARN("(%s %p %u)\n",lpStrSrc,lpwStrDest,len);
return CRTDLL_wcsncpy(lpwStrDest, lpStrSrc, len);
return NTDLL_wcsncpy(lpwStrDest, lpStrSrc, len);
}
/*************************************************************************
......@@ -1120,9 +1123,11 @@ LPWSTR WINAPI SHLWAPI_215 (
HANDLE WINAPI SHLWAPI_222 (LPCLSID guid)
{
char lpstrName[80];
strcpy( lpstrName,"shell.");
WINE_StringFromCLSID(guid, lpstrName + strlen(lpstrName));
sprintf( lpstrName, "shell.{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
FIXME("(%s) stub\n", lpstrName);
return CreateSemaphoreA(NULL,0, 0x7fffffff, lpstrName);
}
......
......@@ -798,11 +798,4 @@ void WINAPI CoUninitialize(void);
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
HRESULT WINAPI DllCanUnloadNow(void);
/*****************************************************************************
* Internal WINE API
*/
#ifdef __WINE__
HRESULT WINE_StringFromCLSID(const CLSID *id, LPSTR);
#endif
#endif /* __WINE_WINE_OBJ_BASE_H */
......@@ -26,9 +26,9 @@
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ntddk.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "task.h"
#include "heap.h"
......@@ -283,7 +283,6 @@ DWORD WINAPI CharLowerBuffA(LPSTR x,DWORD buflen)
/***********************************************************************
* CharLowerBuffW (USER32.27)
* FIXME: handle current locale
*/
DWORD WINAPI CharLowerBuffW(LPWSTR x,DWORD buflen)
{
......@@ -292,7 +291,7 @@ DWORD WINAPI CharLowerBuffW(LPWSTR x,DWORD buflen)
if (!x) return 0; /* YES */
while (*x && (buflen--))
{
*x=NTDLL_towlower(*x);
*x=tolowerW(*x);
x++;
done++;
}
......@@ -310,12 +309,12 @@ LPWSTR WINAPI CharLowerW(LPWSTR x)
LPWSTR s = x;
while (*s)
{
*s=NTDLL_towlower(*s);
*s = tolowerW(*s);
s++;
}
return x;
}
else return (LPWSTR)((UINT)NTDLL_towlower(LOWORD(x)));
else return (LPWSTR)((UINT)tolowerW(LOWORD(x)));
}
/***********************************************************************
......@@ -366,7 +365,7 @@ DWORD WINAPI CharUpperBuffW(LPWSTR x,DWORD buflen)
if (!x) return 0; /* YES */
while (*x && (buflen--))
{
*x=NTDLL_towupper(*x);
*x=toupperW(*x);
x++;
done++;
}
......@@ -384,12 +383,12 @@ LPWSTR WINAPI CharUpperW(LPWSTR x)
LPWSTR s = x;
while (*s)
{
*s=NTDLL_towupper(*s);
*s = toupperW(*s);
s++;
}
return x;
}
else return (LPWSTR)((UINT)NTDLL_towupper(LOWORD(x)));
else return (LPWSTR)((UINT)toupperW(LOWORD(x)));
}
/***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment