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
c4a9a296
Commit
c4a9a296
authored
Nov 26, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Use wide-char string literals.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
067c0772
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
150 deletions
+73
-150
oleaut.c
dlls/oleaut32/oleaut.c
+13
-28
olefont.c
dlls/oleaut32/olefont.c
+17
-33
olepicture.c
dlls/oleaut32/olepicture.c
+2
-4
olepropframe.c
dlls/oleaut32/olepropframe.c
+1
-3
typelib.c
dlls/oleaut32/typelib.c
+35
-70
vartype.c
dlls/oleaut32/vartype.c
+5
-12
No files found.
dlls/oleaut32/oleaut.c
View file @
c4a9a296
...
...
@@ -505,9 +505,6 @@ void WINAPI SetOaNoCache(void)
bstr_cache_enabled
=
FALSE
;
}
static
const
WCHAR
_delimiter
[]
=
{
'!'
,
0
};
/* default delimiter apparently */
static
const
WCHAR
*
pdelimiter
=
&
_delimiter
[
0
];
/***********************************************************************
* RegisterActiveObject (OLEAUT32.33)
*
...
...
@@ -533,7 +530,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject(
DWORD
rot_flags
=
ROTFLAGS_REGISTRATIONKEEPSALIVE
;
/* default registration is strong */
StringFromGUID2
(
rcid
,
guidbuf
,
39
);
ret
=
CreateItemMoniker
(
pdelimiter
,
guidbuf
,
&
moniker
);
ret
=
CreateItemMoniker
(
L"!"
,
guidbuf
,
&
moniker
);
if
(
FAILED
(
ret
))
return
ret
;
ret
=
GetRunningObjectTable
(
0
,
&
runobtable
);
...
...
@@ -597,7 +594,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject(REFCLSID rcid,LPVOID preserved,
LPMONIKER
moniker
;
StringFromGUID2
(
rcid
,
guidbuf
,
39
);
ret
=
CreateItemMoniker
(
pdelimiter
,
guidbuf
,
&
moniker
);
ret
=
CreateItemMoniker
(
L"!"
,
guidbuf
,
&
moniker
);
if
(
FAILED
(
ret
))
return
ret
;
ret
=
GetRunningObjectTable
(
0
,
&
runobtable
);
...
...
@@ -1104,10 +1101,8 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstDll
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
static
const
WCHAR
oanocacheW
[]
=
{
'o'
,
'a'
,
'n'
,
'o'
,
'c'
,
'a'
,
'c'
,
'h'
,
'e'
,
0
};
if
(
fdwReason
==
DLL_PROCESS_ATTACH
)
bstr_cache_enabled
=
!
GetEnvironmentVariableW
(
oanocacheW
,
NULL
,
0
);
bstr_cache_enabled
=
!
GetEnvironmentVariableW
(
L"oanocache"
,
NULL
,
0
);
return
OLEAUTPS_DllMain
(
hInstDll
,
fdwReason
,
lpvReserved
);
}
...
...
@@ -1173,33 +1168,23 @@ HRESULT WINAPI GetAltMonthNames(LCID lcid, LPOLESTR **str)
NULL
};
static
const
WCHAR
pl_month1W
[]
=
{
's'
,
't'
,
'y'
,
'c'
,
'z'
,
'n'
,
'i'
,
'a'
,
0
};
static
const
WCHAR
pl_month2W
[]
=
{
'l'
,
'u'
,
't'
,
'e'
,
'g'
,
'o'
,
0
};
static
const
WCHAR
pl_month3W
[]
=
{
'm'
,
'a'
,
'r'
,
'c'
,
'a'
,
0
};
static
const
WCHAR
pl_month4W
[]
=
{
'k'
,
'w'
,
'i'
,
'e'
,
't'
,
'n'
,
'i'
,
'a'
,
0
};
static
const
WCHAR
pl_month5W
[]
=
{
'm'
,
'a'
,
'j'
,
'a'
,
0
};
static
const
WCHAR
pl_month6W
[]
=
{
'c'
,
'z'
,
'e'
,
'r'
,
'w'
,
'c'
,
'a'
,
0
};
static
const
WCHAR
pl_month7W
[]
=
{
'l'
,
'i'
,
'p'
,
'c'
,
'a'
,
0
};
static
const
WCHAR
pl_month8W
[]
=
{
's'
,
'i'
,
'e'
,
'r'
,
'p'
,
'n'
,
'i'
,
'a'
,
0
};
static
const
WCHAR
pl_month9W
[]
=
{
'w'
,
'r'
,
'z'
,
'e'
,
0x15b
,
'n'
,
'i'
,
'a'
,
0
};
static
const
WCHAR
pl_month10W
[]
=
{
'p'
,
'a'
,
0x17a
,
'd'
,
'z'
,
'i'
,
'e'
,
'r'
,
'n'
,
'i'
,
'k'
,
'a'
,
0
};
static
const
WCHAR
pl_month11W
[]
=
{
'l'
,
'i'
,
's'
,
't'
,
'o'
,
'p'
,
'a'
,
'd'
,
'a'
,
0
};
static
const
WCHAR
pl_month12W
[]
=
{
'g'
,
'r'
,
'u'
,
'd'
,
'n'
,
'i'
,
'a'
,
0
};
static
const
WCHAR
*
polish_genitive_names
[]
=
{
pl_month1W
,
pl_month2W
,
pl_month3W
,
pl_month4W
,
pl_month5W
,
pl_month6W
,
pl_month7W
,
pl_month8W
,
L"stycznia"
,
L"lutego"
,
L"marca"
,
L"kwietnia"
,
L"maja"
,
L"czerwca"
,
L"lipca"
,
L"sierpnia"
,
pl_month9W
,
pl_month10W
,
pl_month11W
,
pl_month12W
,
L"listopada"
,
L"grudnia"
,
NULL
};
...
...
dlls/oleaut32/olefont.c
View file @
c4a9a296
...
...
@@ -374,25 +374,17 @@ HRESULT WINAPI OleCreateFontIndirect(
*/
static
void
OLEFont_SendNotify
(
OLEFontImpl
*
this
,
DISPID
dispID
)
{
static
const
WCHAR
wszName
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
wszSize
[]
=
{
'S'
,
'i'
,
'z'
,
'e'
,
0
};
static
const
WCHAR
wszBold
[]
=
{
'B'
,
'o'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
wszItalic
[]
=
{
'I'
,
't'
,
'a'
,
'l'
,
'i'
,
'c'
,
0
};
static
const
WCHAR
wszUnder
[]
=
{
'U'
,
'n'
,
'd'
,
'e'
,
'r'
,
'l'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
wszStrike
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'k'
,
'e'
,
't'
,
'h'
,
'r'
,
'o'
,
'u'
,
'g'
,
'h'
,
0
};
static
const
WCHAR
wszWeight
[]
=
{
'W'
,
'e'
,
'i'
,
'g'
,
'h'
,
't'
,
0
};
static
const
WCHAR
wszCharset
[]
=
{
'C'
,
'h'
,
'a'
,
'r'
,
's'
,
'e'
,
't'
,
0
};
static
const
LPCWSTR
dispid_mapping
[]
=
{
wszName
,
NULL
,
wszSize
,
wszBold
,
wszItalic
,
wszUnder
,
wszStrike
,
wszWeight
,
wszCharset
L"Name"
,
NULL
,
L"Size"
,
L"Bold"
,
L"Italic"
,
L"Underline"
,
L"Strikethrough"
,
L"Weight"
,
L"Charset"
};
IEnumConnections
*
pEnum
;
...
...
@@ -1237,7 +1229,6 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
static
const
WCHAR
stdole2tlb
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
ITypeLib
*
tl
;
HRESULT
hres
;
...
...
@@ -1245,7 +1236,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
TRACE
(
"(%p, iTInfo=%d, lcid=%04x, %p)
\n
"
,
this
,
iTInfo
,
(
int
)
lcid
,
ppTInfo
);
if
(
iTInfo
!=
0
)
return
E_FAIL
;
hres
=
LoadTypeLib
(
stdole2tlb
,
&
tl
);
hres
=
LoadTypeLib
(
L"stdole2.tlb"
,
&
tl
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not load the stdole2.tlb?
\n
"
);
return
hres
;
...
...
@@ -1912,20 +1903,13 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
Italic = 0 'False
Strikethrough = 0 'False
*/
static
const
WCHAR
sAttrName
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
sAttrSize
[]
=
{
'S'
,
'i'
,
'z'
,
'e'
,
0
};
static
const
WCHAR
sAttrCharset
[]
=
{
'C'
,
'h'
,
'a'
,
'r'
,
's'
,
'e'
,
't'
,
0
};
static
const
WCHAR
sAttrWeight
[]
=
{
'W'
,
'e'
,
'i'
,
'g'
,
'h'
,
't'
,
0
};
static
const
WCHAR
sAttrUnderline
[]
=
{
'U'
,
'n'
,
'd'
,
'e'
,
'r'
,
'l'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
sAttrItalic
[]
=
{
'I'
,
't'
,
'a'
,
'l'
,
'i'
,
'c'
,
0
};
static
const
WCHAR
sAttrStrikethrough
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'k'
,
'e'
,
't'
,
'h'
,
'r'
,
'o'
,
'u'
,
'g'
,
'h'
,
0
};
OLEFontImpl
*
this
=
impl_from_IPersistPropertyBag
(
iface
);
VARIANT
value
;
HRESULT
iRes
;
VariantInit
(
&
value
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrName
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Name"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_BSTR
);
...
...
@@ -1938,7 +1922,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
VariantClear
(
&
value
);
if
(
iRes
==
S_OK
)
{
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrSize
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Size"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_CY
);
...
...
@@ -1952,7 +1936,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if
(
iRes
==
S_OK
)
{
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrCharset
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Charset"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_I2
);
...
...
@@ -1966,7 +1950,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if
(
iRes
==
S_OK
)
{
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrWeight
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Weight"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_I2
);
...
...
@@ -1980,7 +1964,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if
(
iRes
==
S_OK
)
{
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrUnderline
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Underline"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_BOOL
);
...
...
@@ -1994,7 +1978,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if
(
iRes
==
S_OK
)
{
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrItalic
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Italic"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_BOOL
);
...
...
@@ -2008,7 +1992,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
}
if
(
iRes
==
S_OK
)
{
iRes
=
IPropertyBag_Read
(
pPropBag
,
sAttrStrikethrough
,
&
value
,
pErrorLog
);
iRes
=
IPropertyBag_Read
(
pPropBag
,
L"Strikethrough"
,
&
value
,
pErrorLog
);
if
(
iRes
==
S_OK
)
{
iRes
=
VariantChangeType
(
&
value
,
&
value
,
0
,
VT_BOOL
);
...
...
dlls/oleaut32/olepicture.c
View file @
c4a9a296
...
...
@@ -1947,7 +1947,6 @@ static HRESULT WINAPI OLEPictureImpl_GetTypeInfo(
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
static
const
WCHAR
stdole2tlb
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
ITypeLib
*
tl
;
HRESULT
hres
;
...
...
@@ -1956,7 +1955,7 @@ static HRESULT WINAPI OLEPictureImpl_GetTypeInfo(
if
(
iTInfo
!=
0
)
return
E_FAIL
;
hres
=
LoadTypeLib
(
stdole2tlb
,
&
tl
);
hres
=
LoadTypeLib
(
L"stdole2.tlb"
,
&
tl
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not load stdole2.tlb
\n
"
);
...
...
@@ -2353,7 +2352,6 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
DWORD
dwReserved
,
OLE_COLOR
clrReserved
,
REFIID
riid
,
LPVOID
*
ppvRet
)
{
static
const
WCHAR
file
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
0
};
IPicture
*
ipicture
;
HANDLE
hFile
;
DWORD
dwFileSize
;
...
...
@@ -2377,7 +2375,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
*
ppvRet
=
NULL
;
/* Convert file URLs to DOS paths. */
if
(
wcsncmp
(
szURLorPath
,
file
,
5
)
==
0
)
{
if
(
wcsncmp
(
szURLorPath
,
L"file:"
,
5
)
==
0
)
{
DWORD
size
;
hRes
=
CoInternetParseUrl
(
szURLorPath
,
PARSE_PATH_FROM_URL
,
0
,
path_buf
,
ARRAY_SIZE
(
path_buf
),
&
size
,
0
);
...
...
dlls/oleaut32/olepropframe.c
View file @
c4a9a296
...
...
@@ -154,8 +154,6 @@ static IPropertyPageSiteVtbl PropertyPageSiteVtbl = {
*/
HRESULT
WINAPI
OleCreatePropertyFrameIndirect
(
LPOCPFIPARAMS
lpParams
)
{
static
const
WCHAR
comctlW
[]
=
{
'c'
,
'o'
,
'm'
,
'c'
,
't'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
PROPSHEETHEADERW
property_sheet
;
PROPSHEETPAGEW
property_sheet_page
;
struct
{
...
...
@@ -198,7 +196,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
FIXME
(
"dispidInitialProperty not yet implemented
\n
"
);
hdc
=
GetDC
(
NULL
);
hcomctl
=
LoadLibraryW
(
comctlW
);
hcomctl
=
LoadLibraryW
(
L"comctl32.dll"
);
if
(
hcomctl
)
property_sheet_dialog_find
=
FindResourceW
(
hcomctl
,
MAKEINTRESOURCEW
(
1006
/*IDD_PROPSHEET*/
),
(
LPWSTR
)
RT_DIALOG
);
...
...
dlls/oleaut32/typelib.c
View file @
c4a9a296
...
...
@@ -171,14 +171,13 @@ static void FromLEDWords(void *p_Val, int p_iSize)
*/
static
BOOL
find_typelib_key
(
REFGUID
guid
,
WORD
*
wMaj
,
WORD
*
wMin
)
{
static
const
WCHAR
typelibW
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
'l'
,
'i'
,
'b'
,
'\\'
,
0
};
WCHAR
buffer
[
60
];
char
key_name
[
16
];
DWORD
len
,
i
;
INT
best_maj
=
-
1
,
best_min
=
-
1
;
HKEY
hkey
;
memcpy
(
buffer
,
typelibW
,
sizeof
(
typelibW
)
);
lstrcpyW
(
buffer
,
L"Typelib
\\
"
);
StringFromGUID2
(
guid
,
buffer
+
lstrlenW
(
buffer
),
40
);
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_READ
,
&
hkey
)
!=
ERROR_SUCCESS
)
...
...
@@ -239,12 +238,9 @@ static BOOL find_typelib_key( REFGUID guid, WORD *wMaj, WORD *wMin )
/* buffer must be at least 60 characters long */
static
WCHAR
*
get_typelib_key
(
REFGUID
guid
,
WORD
wMaj
,
WORD
wMin
,
WCHAR
*
buffer
)
{
static
const
WCHAR
TypelibW
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
'l'
,
'i'
,
'b'
,
'\\'
,
0
};
static
const
WCHAR
VersionFormatW
[]
=
{
'\\'
,
'%'
,
'x'
,
'.'
,
'%'
,
'x'
,
0
};
memcpy
(
buffer
,
TypelibW
,
sizeof
(
TypelibW
)
);
lstrcpyW
(
buffer
,
L"Typelib
\\
"
);
StringFromGUID2
(
guid
,
buffer
+
lstrlenW
(
buffer
),
40
);
swprintf
(
buffer
+
lstrlenW
(
buffer
),
20
,
VersionFormatW
,
wMaj
,
wMin
);
swprintf
(
buffer
+
lstrlenW
(
buffer
),
20
,
L"
\\
%x.%x"
,
wMaj
,
wMin
);
return
buffer
;
}
...
...
@@ -252,9 +248,7 @@ static WCHAR *get_typelib_key( REFGUID guid, WORD wMaj, WORD wMin, WCHAR *buffer
/* buffer must be at least 50 characters long */
static
WCHAR
*
get_interface_key
(
REFGUID
guid
,
WCHAR
*
buffer
)
{
static
const
WCHAR
InterfaceW
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'\\'
,
0
};
memcpy
(
buffer
,
InterfaceW
,
sizeof
(
InterfaceW
)
);
lstrcpyW
(
buffer
,
L"Interface
\\
"
);
StringFromGUID2
(
guid
,
buffer
+
lstrlenW
(
buffer
),
40
);
return
buffer
;
}
...
...
@@ -263,17 +257,12 @@ static WCHAR *get_interface_key( REFGUID guid, WCHAR *buffer )
/* buffer must be at least 16 characters long */
static
WCHAR
*
get_lcid_subkey
(
LCID
lcid
,
SYSKIND
syskind
,
WCHAR
*
buffer
)
{
static
const
WCHAR
LcidFormatW
[]
=
{
'%'
,
'l'
,
'x'
,
'\\'
,
0
};
static
const
WCHAR
win16W
[]
=
{
'w'
,
'i'
,
'n'
,
'1'
,
'6'
,
0
};
static
const
WCHAR
win32W
[]
=
{
'w'
,
'i'
,
'n'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
win64W
[]
=
{
'w'
,
'i'
,
'n'
,
'6'
,
'4'
,
0
};
swprintf
(
buffer
,
16
,
LcidFormatW
,
lcid
);
swprintf
(
buffer
,
16
,
L"%lx
\\
"
,
lcid
);
switch
(
syskind
)
{
case
SYS_WIN16
:
lstrcatW
(
buffer
,
win16W
);
break
;
case
SYS_WIN32
:
lstrcatW
(
buffer
,
win32W
);
break
;
case
SYS_WIN64
:
lstrcatW
(
buffer
,
win64W
);
break
;
case
SYS_WIN16
:
lstrcatW
(
buffer
,
L"win16"
);
break
;
case
SYS_WIN32
:
lstrcatW
(
buffer
,
L"win32"
);
break
;
case
SYS_WIN64
:
lstrcatW
(
buffer
,
L"win64"
);
break
;
default:
TRACE
(
"Typelib is for unsupported syskind %i
\n
"
,
syskind
);
return
NULL
;
...
...
@@ -562,26 +551,11 @@ HRESULT WINAPI LoadRegTypeLib(
return
res
;
}
/* some string constants shared between RegisterTypeLib and UnRegisterTypeLib */
static
const
WCHAR
TypeLibW
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
'L'
,
'i'
,
'b'
,
0
};
static
const
WCHAR
FLAGSW
[]
=
{
'F'
,
'L'
,
'A'
,
'G'
,
'S'
,
0
};
static
const
WCHAR
HELPDIRW
[]
=
{
'H'
,
'E'
,
'L'
,
'P'
,
'D'
,
'I'
,
'R'
,
0
};
static
const
WCHAR
ProxyStubClsidW
[]
=
{
'P'
,
'r'
,
'o'
,
'x'
,
'y'
,
'S'
,
't'
,
'u'
,
'b'
,
'C'
,
'l'
,
's'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
ProxyStubClsid32W
[]
=
{
'P'
,
'r'
,
'o'
,
'x'
,
'y'
,
'S'
,
't'
,
'u'
,
'b'
,
'C'
,
'l'
,
's'
,
'i'
,
'd'
,
'3'
,
'2'
,
0
};
static
void
TLB_register_interface
(
TLIBATTR
*
libattr
,
LPOLESTR
name
,
TYPEATTR
*
tattr
,
DWORD
flag
)
{
WCHAR
keyName
[
60
];
HKEY
key
,
subKey
;
static
const
WCHAR
typelib_proxy_clsid
[]
=
{
'{'
,
'0'
,
'0'
,
'0'
,
'2'
,
'0'
,
'4'
,
'2'
,
'4'
,
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'-'
,
'C'
,
'0'
,
'0'
,
'0'
,
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'4'
,
'6'
,
'}'
,
0
};
static
const
WCHAR
dispatch_proxy_clsid
[]
=
{
'{'
,
'0'
,
'0'
,
'0'
,
'2'
,
'0'
,
'4'
,
'2'
,
'0'
,
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'-'
,
'C'
,
'0'
,
'0'
,
'0'
,
'-'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'4'
,
'6'
,
'}'
,
0
};
get_interface_key
(
&
tattr
->
guid
,
keyName
);
if
(
RegCreateKeyExW
(
HKEY_CLASSES_ROOT
,
keyName
,
0
,
NULL
,
0
,
KEY_WRITE
|
flag
,
NULL
,
&
key
,
NULL
)
==
ERROR_SUCCESS
)
...
...
@@ -589,41 +563,36 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t
const
WCHAR
*
proxy_clsid
;
if
(
tattr
->
typekind
==
TKIND_INTERFACE
||
(
tattr
->
wTypeFlags
&
TYPEFLAG_FDUAL
))
proxy_clsid
=
typelib_proxy_clsid
;
proxy_clsid
=
L"{00020424-0000-0000-C000-000000000046}"
;
else
proxy_clsid
=
dispatch_proxy_clsid
;
proxy_clsid
=
L"{00020420-0000-0000-C000-000000000046}"
;
if
(
name
)
RegSetValueExW
(
key
,
NULL
,
0
,
REG_SZ
,
(
BYTE
*
)
name
,
(
lstrlenW
(
name
)
+
1
)
*
sizeof
(
OLECHAR
));
if
(
RegCreateKeyExW
(
key
,
ProxyStubClsidW
,
0
,
NULL
,
0
,
KEY_WRITE
|
flag
,
NULL
,
&
subKey
,
NULL
)
==
ERROR_SUCCESS
)
{
RegSetValueExW
(
subKey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
proxy_clsid
,
sizeof
(
typelib_proxy_clsid
));
if
(
!
RegCreateKeyExW
(
key
,
L"ProxyStubClsid"
,
0
,
NULL
,
0
,
KEY_WRITE
|
flag
,
NULL
,
&
subKey
,
NULL
))
{
RegSetValueExW
(
subKey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
proxy_clsid
,
(
lstrlenW
(
proxy_clsid
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
subKey
);
}
if
(
RegCreateKeyExW
(
key
,
ProxyStubClsid32W
,
0
,
NULL
,
0
,
KEY_WRITE
|
flag
,
NULL
,
&
subKey
,
NULL
)
==
ERROR_SUCCESS
)
{
RegSetValueExW
(
subKey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
proxy_clsid
,
sizeof
(
typelib_proxy_clsid
));
if
(
!
RegCreateKeyExW
(
key
,
L"ProxyStubClsid32"
,
0
,
NULL
,
0
,
KEY_WRITE
|
flag
,
NULL
,
&
subKey
,
NULL
))
{
RegSetValueExW
(
subKey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
proxy_clsid
,
(
lstrlenW
(
proxy_clsid
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
subKey
);
}
if
(
RegCreateKeyExW
(
key
,
TypeLibW
,
0
,
NULL
,
0
,
if
(
RegCreateKeyExW
(
key
,
L"TypeLib"
,
0
,
NULL
,
0
,
KEY_WRITE
|
flag
,
NULL
,
&
subKey
,
NULL
)
==
ERROR_SUCCESS
)
{
WCHAR
buffer
[
40
];
static
const
WCHAR
fmtver
[]
=
{
'%'
,
'x'
,
'.'
,
'%'
,
'x'
,
0
};
static
const
WCHAR
VersionW
[]
=
{
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
StringFromGUID2
(
&
libattr
->
guid
,
buffer
,
40
);
RegSetValueExW
(
subKey
,
NULL
,
0
,
REG_SZ
,
(
BYTE
*
)
buffer
,
(
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
));
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
fmtver
,
libattr
->
wMajorVerNum
,
libattr
->
wMinorVerNum
);
RegSetValueExW
(
subKey
,
VersionW
,
0
,
REG_SZ
,
(
BYTE
*
)
buffer
,
(
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
));
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%x.%x"
,
libattr
->
wMajorVerNum
,
libattr
->
wMinorVerNum
);
RegSetValueExW
(
subKey
,
L"Version"
,
0
,
REG_SZ
,
(
BYTE
*
)
buffer
,
(
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
subKey
);
}
...
...
@@ -701,13 +670,13 @@ HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const W
res
=
E_FAIL
;
/* Create the flags subkey */
if
(
res
==
S_OK
&&
RegCreateKeyExW
(
key
,
FLAGSW
,
0
,
NULL
,
0
,
if
(
res
==
S_OK
&&
RegCreateKeyExW
(
key
,
L"FLAGS"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
subKey
,
NULL
)
==
ERROR_SUCCESS
)
{
/* FIXME: is %u correct? */
static
const
WCHAR
formatW
[]
=
{
'%'
,
'u'
,
0
};
WCHAR
buf
[
20
];
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
formatW
,
attr
->
wLibFlags
);
/* FIXME: is %u correct? */
swprintf
(
buf
,
ARRAY_SIZE
(
buf
),
L"%u"
,
attr
->
wLibFlags
);
if
(
RegSetValueExW
(
subKey
,
NULL
,
0
,
REG_SZ
,
(
BYTE
*
)
buf
,
(
lstrlenW
(
buf
)
+
1
)
*
sizeof
(
WCHAR
)
)
!=
ERROR_SUCCESS
)
res
=
E_FAIL
;
...
...
@@ -718,7 +687,7 @@ HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const W
res
=
E_FAIL
;
/* create the helpdir subkey */
if
(
res
==
S_OK
&&
RegCreateKeyExW
(
key
,
HELPDIRW
,
0
,
NULL
,
0
,
if
(
res
==
S_OK
&&
RegCreateKeyExW
(
key
,
L"HELPDIR"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
subKey
,
&
disposition
)
==
ERROR_SUCCESS
)
{
BSTR
freeHelpDir
=
NULL
;
...
...
@@ -862,9 +831,9 @@ static void TLB_unregister_interface(GUID *guid, REGSAM flag)
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
subKeyName
,
0
,
KEY_WRITE
|
flag
,
&
subKey
)
!=
ERROR_SUCCESS
)
return
;
RegDeleteKeyW
(
subKey
,
ProxyStubClsidW
);
RegDeleteKeyW
(
subKey
,
ProxyStubClsid32W
);
RegDeleteKeyW
(
subKey
,
TypeLibW
);
RegDeleteKeyW
(
subKey
,
L"ProxyStubClsid"
);
RegDeleteKeyW
(
subKey
,
L"ProxyStubClsid32"
);
RegDeleteKeyW
(
subKey
,
L"TypeLib"
);
RegCloseKey
(
subKey
);
RegDeleteKeyExW
(
HKEY_CLASSES_ROOT
,
subKeyName
,
flag
,
0
);
}
...
...
@@ -985,16 +954,16 @@ enddeleteloop:
tmpLength
=
ARRAY_SIZE
(
subKeyName
);
/* if its not FLAGS or HELPDIR, then we must keep the rest of the key */
if
(
!
wcscmp
(
subKeyName
,
FLAGSW
))
continue
;
if
(
!
wcscmp
(
subKeyName
,
HELPDIRW
))
continue
;
if
(
!
wcscmp
(
subKeyName
,
L"FLAGS"
))
continue
;
if
(
!
wcscmp
(
subKeyName
,
L"HELPDIR"
))
continue
;
deleteOtherStuff
=
FALSE
;
break
;
}
/* only delete the other parts of the key if we're absolutely sure */
if
(
deleteOtherStuff
)
{
RegDeleteKeyW
(
key
,
FLAGSW
);
RegDeleteKeyW
(
key
,
HELPDIRW
);
RegDeleteKeyW
(
key
,
L"FLAGS"
);
RegDeleteKeyW
(
key
,
L"HELPDIR"
);
RegCloseKey
(
key
);
key
=
NULL
;
...
...
@@ -2970,8 +2939,7 @@ static HRESULT TLB_PEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *p
if
(
This
->
dll
)
{
static
const
WCHAR
TYPELIBW
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
This
->
typelib_resource
=
FindResourceW
(
This
->
dll
,
MAKEINTRESOURCEW
(
index
),
TYPELIBW
);
This
->
typelib_resource
=
FindResourceW
(
This
->
dll
,
MAKEINTRESOURCEW
(
index
),
L"TYPELIB"
);
if
(
This
->
typelib_resource
)
{
This
->
typelib_global
=
LoadResource
(
This
->
dll
,
This
->
typelib_resource
);
...
...
@@ -7919,7 +7887,6 @@ struct search_res_tlb_params
static
BOOL
CALLBACK
search_res_tlb
(
HMODULE
hModule
,
LPCWSTR
lpszType
,
LPWSTR
lpszName
,
LONG_PTR
lParam
)
{
struct
search_res_tlb_params
*
params
=
(
LPVOID
)
lParam
;
static
const
WCHAR
formatW
[]
=
{
'\\'
,
'%'
,
'd'
,
0
};
WCHAR
szPath
[
MAX_PATH
+
1
];
ITypeLib
*
pTLib
=
NULL
;
HRESULT
ret
;
...
...
@@ -7931,7 +7898,7 @@ static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lp
if
(
!
(
len
=
GetModuleFileNameW
(
hModule
,
szPath
,
MAX_PATH
)))
return
TRUE
;
if
(
swprintf
(
szPath
+
len
,
ARRAY_SIZE
(
szPath
)
-
len
,
formatW
,
LOWORD
(
lpszName
))
<
0
)
if
(
swprintf
(
szPath
+
len
,
ARRAY_SIZE
(
szPath
)
-
len
,
L"
\\
%d"
,
LOWORD
(
lpszName
))
<
0
)
return
TRUE
;
ret
=
LoadTypeLibEx
(
szPath
,
REGKIND_NONE
,
&
pTLib
);
...
...
@@ -8068,7 +8035,6 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
if
(
!
pTLib
)
{
static
const
WCHAR
TYPELIBW
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
struct
search_res_tlb_params
params
;
TRACE
(
"typeinfo in imported typelib that isn't already loaded
\n
"
);
...
...
@@ -8076,7 +8042,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
/* Search in resource table */
params
.
guid
=
TLB_get_guid_null
(
ref_type
->
pImpTLInfo
->
guid
);
params
.
pTLib
=
NULL
;
EnumResourceNamesW
(
NULL
,
TYPELIBW
,
search_res_tlb
,
(
LONG_PTR
)
&
params
);
EnumResourceNamesW
(
NULL
,
L"TYPELIB"
,
search_res_tlb
,
(
LONG_PTR
)
&
params
);
if
(
params
.
pTLib
)
{
pTLib
=
params
.
pTLib
;
...
...
@@ -10624,13 +10590,12 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface,
TRACE
(
"%p %x
\n
"
,
This
,
typeFlags
);
if
(
typeFlags
&
TYPEFLAG_FDUAL
)
{
static
const
WCHAR
stdole2tlb
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
ITypeLib
*
stdole
;
ITypeInfo
*
dispatch
;
HREFTYPE
hreftype
;
HRESULT
hres
;
hres
=
LoadTypeLib
(
stdole2tlb
,
&
stdole
);
hres
=
LoadTypeLib
(
L"stdole2.tlb"
,
&
stdole
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/oleaut32/vartype.c
View file @
c4a9a296
...
...
@@ -38,9 +38,6 @@ extern HMODULE hProxyDll DECLSPEC_HIDDEN;
#define CY_HALF (CY_MULTIPLIER/2)
/* 0.5 */
#define CY_HALF_F (CY_MULTIPLIER_F/2.0)
static
const
WCHAR
szFloatFormatW
[]
=
{
'%'
,
'.'
,
'7'
,
'G'
,
'\0'
};
static
const
WCHAR
szDoubleFormatW
[]
=
{
'%'
,
'.'
,
'1'
,
'5'
,
'G'
,
'\0'
};
/* Copy data from one variant to another. */
static
inline
void
VARIANT_CopyData
(
const
VARIANT
*
srcVar
,
VARTYPE
vt
,
void
*
pOut
)
{
...
...
@@ -6111,9 +6108,6 @@ static BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest)
*/
HRESULT
WINAPI
VarBoolFromStr
(
OLECHAR
*
strIn
,
LCID
lcid
,
ULONG
dwFlags
,
VARIANT_BOOL
*
pBoolOut
)
{
/* Any VB/VBA programmers out there should recognise these strings... */
static
const
WCHAR
szFalse
[]
=
{
'#'
,
'F'
,
'A'
,
'L'
,
'S'
,
'E'
,
'#'
,
'\0'
};
static
const
WCHAR
szTrue
[]
=
{
'#'
,
'T'
,
'R'
,
'U'
,
'E'
,
'#'
,
'\0'
};
WCHAR
szBuff
[
64
];
LANGID
langId
=
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
);
HRESULT
hRes
=
S_OK
;
...
...
@@ -6170,9 +6164,9 @@ VarBoolFromStr_CheckLocalised:
}
/* All checks against localised text have failed, try #TRUE#/#FALSE# */
if
(
!
wcscmp
(
strIn
,
szFalse
))
if
(
!
wcscmp
(
strIn
,
L"#FALSE#"
))
*
pBoolOut
=
VARIANT_FALSE
;
else
if
(
!
wcscmp
(
strIn
,
szTrue
))
else
if
(
!
wcscmp
(
strIn
,
L"#TRUE#"
))
*
pBoolOut
=
VARIANT_TRUE
;
else
{
...
...
@@ -6521,8 +6515,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
*/
if
(
buff
[
0
]
==
'-'
)
{
static
const
WCHAR
szAccept
[]
=
{
'0'
,
'.'
,
'\0'
};
if
(
lstrlenW
(
buff
+
1
)
==
wcsspn
(
buff
+
1
,
szAccept
))
if
(
lstrlenW
(
buff
+
1
)
==
wcsspn
(
buff
+
1
,
L"0."
))
{
buff
[
0
]
=
'0'
;
buff
[
1
]
=
'\0'
;
}
}
...
...
@@ -6563,7 +6556,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags,
*/
HRESULT
WINAPI
VarBstrFromR4
(
FLOAT
fltIn
,
LCID
lcid
,
ULONG
dwFlags
,
BSTR
*
pbstrOut
)
{
return
VARIANT_BstrFromReal
(
fltIn
,
lcid
,
dwFlags
,
pbstrOut
,
szFloatFormatW
);
return
VARIANT_BstrFromReal
(
fltIn
,
lcid
,
dwFlags
,
pbstrOut
,
L"%.7G"
);
}
/******************************************************************************
...
...
@@ -6584,7 +6577,7 @@ HRESULT WINAPI VarBstrFromR4(FLOAT fltIn, LCID lcid, ULONG dwFlags, BSTR* pbstrO
*/
HRESULT
WINAPI
VarBstrFromR8
(
double
dblIn
,
LCID
lcid
,
ULONG
dwFlags
,
BSTR
*
pbstrOut
)
{
return
VARIANT_BstrFromReal
(
dblIn
,
lcid
,
dwFlags
,
pbstrOut
,
szDoubleFormatW
);
return
VARIANT_BstrFromReal
(
dblIn
,
lcid
,
dwFlags
,
pbstrOut
,
L"%.15G"
);
}
/******************************************************************************
...
...
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