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
5d9ea809
Commit
5d9ea809
authored
Jun 16, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleview: Use nameless unions/structs.
parent
52a868a8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
101 deletions
+95
-101
details.c
programs/oleview/details.c
+8
-8
interface.c
programs/oleview/interface.c
+1
-1
main.h
programs/oleview/main.h
+0
-6
tree.c
programs/oleview/tree.c
+51
-51
typelib.c
programs/oleview/typelib.c
+35
-35
No files found.
programs/oleview/details.c
View file @
5d9ea809
...
...
@@ -43,9 +43,9 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
TVINSERTSTRUCTW
tvis
;
HTREEITEM
addPlace
=
parent
;
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
;
U
(
tvis
)
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
)
.
item
.
pszText
=
wszTree
;
tvis
.
item
.
mask
=
TVIF_TEXT
;
tvis
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
tvis
.
item
.
pszText
=
wszTree
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
parent
;
...
...
@@ -61,9 +61,9 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
{
if
(
!
i
&&
lstrlenW
(
wszKeyName
)
>
1
)
{
U
(
tvis
)
.
item
.
pszText
=
wszKeyName
;
tvis
.
item
.
pszText
=
wszKeyName
;
addPlace
=
TreeView_InsertItemW
(
details
.
hReg
,
&
tvis
);
U
(
tvis
)
.
item
.
pszText
=
wszTree
;
tvis
.
item
.
pszText
=
wszTree
;
}
break
;
}
...
...
@@ -206,9 +206,9 @@ static void CreateReg(WCHAR *buffer)
TVINSERTSTRUCTW
tvis
;
HTREEITEM
addPlace
=
TVI_ROOT
;
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
;
U
(
tvis
)
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
)
.
item
.
pszText
=
wszTree
;
tvis
.
item
.
mask
=
TVIF_TEXT
;
tvis
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
tvis
.
item
.
pszText
=
wszTree
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
TVI_ROOT
;
...
...
programs/oleview/interface.c
View file @
5d9ea809
...
...
@@ -107,7 +107,7 @@ static INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
IPersistStream_GetSizeMax
((
IPersistStream
*
)
unk
,
&
size
);
IUnknown_Release
(
unk
);
LoadStringW
(
globals
.
hMainInst
,
IDS_BYTES
,
wszBuf
,
ARRAY_SIZE
(
wszBuf
));
wsprintfW
(
wszSize
,
wszFormat
,
U
(
size
)
.
LowPart
,
wszBuf
);
wsprintfW
(
wszSize
,
wszFormat
,
size
.
LowPart
,
wszBuf
);
hObject
=
GetDlgItem
(
hDlgWnd
,
IDC_GETSIZEMAX
);
SetWindowTextW
(
hObject
,
wszSize
);
return
TRUE
;
...
...
programs/oleview/main.h
View file @
5d9ea809
...
...
@@ -26,12 +26,6 @@
#include <commdlg.h>
#include <unknwn.h>
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
#include "resource.h"
#define MAX_LOAD_STRING 256
...
...
programs/oleview/tree.c
View file @
5d9ea809
This diff is collapsed.
Click to expand it.
programs/oleview/typelib.c
View file @
5d9ea809
...
...
@@ -318,26 +318,26 @@ static void CreateTypeInfo(WCHAR *wszAddTo, WCHAR *wszAddAfter, TYPEDESC tdesc,
VTADDTOSTR
(
VT_DATE
);
VTADDTOSTR
(
VT_R8
);
case
VT_CARRAY
:
for
(
i
=
0
;
i
<
U
(
tdesc
)
.
lpadesc
->
cDims
;
i
++
)
for
(
i
=
0
;
i
<
tdesc
.
lpadesc
->
cDims
;
i
++
)
{
wsprintfW
(
wszBuf
,
wszFormat
,
U
(
tdesc
)
.
lpadesc
->
rgbounds
[
i
].
cElements
);
wsprintfW
(
wszBuf
,
wszFormat
,
tdesc
.
lpadesc
->
rgbounds
[
i
].
cElements
);
AddToStrW
(
wszAddAfter
,
wszBuf
);
}
CreateTypeInfo
(
wszAddTo
,
wszAddAfter
,
U
(
tdesc
)
.
lpadesc
->
tdescElem
,
pTypeInfo
);
CreateTypeInfo
(
wszAddTo
,
wszAddAfter
,
tdesc
.
lpadesc
->
tdescElem
,
pTypeInfo
);
break
;
case
VT_SAFEARRAY
:
AddToStrW
(
wszAddTo
,
wszVT_SAFEARRAY
);
AddToStrW
(
wszAddTo
,
L"("
);
CreateTypeInfo
(
wszAddTo
,
wszAddAfter
,
*
U
(
tdesc
)
.
lptdesc
,
pTypeInfo
);
CreateTypeInfo
(
wszAddTo
,
wszAddAfter
,
*
tdesc
.
lptdesc
,
pTypeInfo
);
AddToStrW
(
wszAddTo
,
L")"
);
break
;
case
VT_PTR
:
CreateTypeInfo
(
wszAddTo
,
wszAddAfter
,
*
U
(
tdesc
)
.
lptdesc
,
pTypeInfo
);
CreateTypeInfo
(
wszAddTo
,
wszAddAfter
,
*
tdesc
.
lptdesc
,
pTypeInfo
);
AddToStrW
(
wszAddTo
,
L"*"
);
break
;
case
VT_USERDEFINED
:
hRes
=
ITypeInfo_GetRefTypeInfo
(
pTypeInfo
,
U
(
tdesc
)
.
hreftype
,
&
pRefTypeInfo
);
tdesc
.
hreftype
,
&
pRefTypeInfo
);
if
(
SUCCEEDED
(
hRes
))
{
ITypeInfo_GetDocumentation
(
pRefTypeInfo
,
MEMBERID_NIL
,
...
...
@@ -363,9 +363,9 @@ static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
WCHAR
wszText
[
MAX_LOAD_STRING
];
WCHAR
wszAfter
[
MAX_LOAD_STRING
];
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
U
(
tvis
)
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
)
.
item
.
pszText
=
wszText
;
tvis
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
tvis
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
tvis
.
item
.
pszText
=
wszText
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
hParent
;
...
...
@@ -378,7 +378,7 @@ static int EnumVars(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
NULL
,
NULL
,
NULL
)))
continue
;
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
if
(
pVarDesc
->
memid
<
MIN_VAR_ID
)
{
...
...
@@ -424,9 +424,9 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
WCHAR
wszText
[
MAX_LOAD_STRING
];
WCHAR
wszAfter
[
MAX_LOAD_STRING
];
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
U
(
tvis
)
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
)
.
item
.
pszText
=
wszText
;
tvis
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
tvis
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
tvis
.
item
.
pszText
=
wszText
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
hParent
;
...
...
@@ -439,7 +439,7 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
NULL
,
NULL
,
NULL
)))
continue
;
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
memset
(
wszText
,
0
,
sizeof
(
wszText
));
memset
(
wszAfter
,
0
,
sizeof
(
wszAfter
));
...
...
@@ -448,7 +448,7 @@ static int EnumEnums(ITypeInfo *pTypeInfo, int cVars, HTREEITEM hParent)
{
VARIANT
var
;
VariantInit
(
&
var
);
if
(
VariantChangeType
(
&
var
,
U
(
*
pVarDesc
).
lpvarValue
,
0
,
VT_BSTR
)
==
S_OK
)
if
(
VariantChangeType
(
&
var
,
pVarDesc
->
lpvarValue
,
0
,
VT_BSTR
)
==
S_OK
)
{
AddToStrW
(
wszText
,
wszConst
);
AddToStrW
(
wszText
,
L" "
);
...
...
@@ -488,7 +488,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
WCHAR
szRhs
[]
=
{
'r'
,
'h'
,
's'
,
0
};
/* Right-hand side of a propput */
BOOL
bFirst
;
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
tvis
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
hParent
;
...
...
@@ -512,9 +512,9 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
memset
(
wszText
,
0
,
sizeof
(
wszText
));
memset
(
wszAfter
,
0
,
sizeof
(
wszAfter
));
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
cchTextMax
=
SysStringLen
(
bstrName
);
U
(
tvis
)
.
item
.
pszText
=
bstrName
;
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
cchTextMax
=
SysStringLen
(
bstrName
);
tvis
.
item
.
pszText
=
bstrName
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
bFirst
=
TRUE
;
if
(
pFuncDesc
->
memid
<
MIN_FUNC_ID
||
pTypeAttr
->
wTypeFlags
&
TYPEFLAG_FDUAL
)
{
...
...
@@ -601,7 +601,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
}
bFirst
=
TRUE
;
#define ENUM_PARAM_FLAG(x)\
if(
U(pFuncDesc->lprgelemdescParam[j])
.paramdesc.wParamFlags & x) \
if(
pFuncDesc->lprgelemdescParam[j]
.paramdesc.wParamFlags & x) \
{\
if(bFirst)\
AddToTLDataStrW(tld, L"[");\
...
...
@@ -619,9 +619,9 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
ENUM_PARAM_FLAG
(
PARAMFLAG_FOPT
);
ENUM_PARAM_FLAG
(
PARAMFLAG_FHASCUSTDATA
);
if
(
U
(
pFuncDesc
->
lprgelemdescParam
[
j
])
.
paramdesc
.
wParamFlags
&
PARAMFLAG_FHASDEFAULT
)
if
(
pFuncDesc
->
lprgelemdescParam
[
j
]
.
paramdesc
.
wParamFlags
&
PARAMFLAG_FHASDEFAULT
)
{
VARIANT
var
,
*
param
=&
U
(
pFuncDesc
->
lprgelemdescParam
[
j
])
.
paramdesc
.
pparamdescex
->
varDefaultValue
;
VARIANT
var
,
*
param
=&
pFuncDesc
->
lprgelemdescParam
[
j
]
.
paramdesc
.
pparamdescex
->
varDefaultValue
;
VariantInit
(
&
var
);
if
(
bFirst
)
AddToTLDataStrW
(
tld
,
L"["
);
else
AddToTLDataStrW
(
tld
,
L", "
);
...
...
@@ -684,9 +684,9 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
LoadStringW
(
globals
.
hMainInst
,
IDS_INHERITINTERFACES
,
wszInheritedInterfaces
,
ARRAY_SIZE
(
wszInheritedInterfaces
));
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
;
U
(
tvis
)
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
)
.
item
.
pszText
=
wszInheritedInterfaces
;
tvis
.
item
.
mask
=
TVIF_TEXT
;
tvis
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
tvis
.
item
.
pszText
=
wszInheritedInterfaces
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
hParent
;
...
...
@@ -709,8 +709,8 @@ static int EnumImplTypes(ITypeInfo *pTypeInfo, int cImplTypes, HTREEITEM hParent
continue
;
}
U
(
tvis
)
.
item
.
cchTextMax
=
SysStringLen
(
bstrName
);
U
(
tvis
)
.
item
.
pszText
=
bstrName
;
tvis
.
item
.
cchTextMax
=
SysStringLen
(
bstrName
);
tvis
.
item
.
pszText
=
bstrName
;
hParent
=
TreeView_InsertItemW
(
typelib
.
hTree
,
&
tvis
);
EnumVars
(
pRefTypeInfo
,
pTypeAttr
->
cVars
,
hParent
);
...
...
@@ -1100,9 +1100,9 @@ static int PopulateTree(void)
WCHAR
wszProperties
[]
=
{
'p'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
'\0'
};
WCHAR
wszMethods
[]
=
{
'm'
,
'e'
,
't'
,
'h'
,
'o'
,
'd'
,
's'
,
'\0'
};
U
(
tvis
)
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
U
(
tvis
)
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
U
(
tvis
)
.
item
.
pszText
=
wszText
;
tvis
.
item
.
mask
=
TVIF_TEXT
|
TVIF_PARAM
;
tvis
.
item
.
cchTextMax
=
MAX_LOAD_STRING
;
tvis
.
item
.
pszText
=
wszText
;
tvis
.
hInsertAfter
=
TVI_LAST
;
tvis
.
hParent
=
TVI_ROOT
;
...
...
@@ -1126,7 +1126,7 @@ static int PopulateTree(void)
ITypeLib_GetLibAttr
(
pTypeLib
,
&
pTLibAttr
);
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
AddToTLDataStrW
(
tld
,
wszGeneratedInfo
);
AddToTLDataStrW
(
tld
,
typelib
.
wszFileName
);
AddToTLDataStrW
(
tld
,
L"
\n\n
[
\n
"
);
...
...
@@ -1177,7 +1177,7 @@ static int PopulateTree(void)
memset
(
wszText
,
0
,
sizeof
(
wszText
));
memset
(
wszAfter
,
0
,
sizeof
(
wszAfter
));
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
switch
(
pTypeAttr
->
typekind
)
{
case
TKIND_ENUM
:
...
...
@@ -1259,7 +1259,7 @@ static int PopulateTree(void)
lstrcpyW
(
wszText
,
wszProperties
);
tvis
.
hParent
=
hParent
;
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
AddToTLDataStrW
(
tld
,
wszProperties
);
AddToTLDataStrW
(
tld
,
L":
\n
"
);
tvis
.
hParent
=
TreeView_InsertItemW
(
typelib
.
hTree
,
&
tvis
);
...
...
@@ -1269,7 +1269,7 @@ static int PopulateTree(void)
lstrcpyW
(
wszText
,
wszMethods
);
tvis
.
hParent
=
hParent
;
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
AddToTLDataStrW
(
tld
,
wszMethods
);
AddToTLDataStrW
(
tld
,
L":
\n
"
);
tvis
.
hParent
=
TreeView_InsertItemW
(
typelib
.
hTree
,
&
tvis
);
...
...
@@ -1293,7 +1293,7 @@ static int PopulateTree(void)
memset
(
wszText
,
0
,
sizeof
(
wszText
));
tld
=
InitializeTLData
();
U
(
tvis
)
.
item
.
lParam
=
(
LPARAM
)
tld
;
tvis
.
item
.
lParam
=
(
LPARAM
)
tld
;
ITypeInfo_GetRefTypeInfo
(
pTypeInfo
,
hRefType
,
&
pRefTypeInfo
);
ITypeInfo_GetDocumentation
(
pRefTypeInfo
,
MEMBERID_NIL
,
&
bstrName
,
...
...
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