Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuan Yao
wine
Commits
cd3cdf62
Commit
cd3cdf62
authored
13 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
shell32: COM cleanup in autocomplete.c.
parent
2317815d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/shell32/autocomplete.c
+27
-31
27 additions, 31 deletions
dlls/shell32/autocomplete.c
with
27 additions
and
31 deletions
dlls/shell32/autocomplete.c
+
27
−
31
View file @
cd3cdf62
...
...
@@ -64,8 +64,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef
struct
{
const
IAutoComplete2
Vtbl
*
lpVtbl
;
const
IAutoCompleteDropDown
Vtbl
*
lp
DropDown
Vtbl
;
IAutoComplete2
IAutoComplete2_iface
;
IAutoCompleteDropDown
IAutoComplete
DropDown
_iface
;
LONG
ref
;
BOOL
initialized
;
BOOL
enabled
;
...
...
@@ -85,16 +85,15 @@ static const IAutoCompleteDropDownVtbl acdropdownvt;
static
const
WCHAR
autocomplete_propertyW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'A'
,
'u'
,
't'
,
'o'
,
'c'
,
'o'
,
'm'
,
'p'
,
'l'
,
'e'
,
't'
,
'e'
,
' '
,
'c'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
0
};
/*
converts This to an interface pointer
*/
#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl)
#define _IAutoComplete2_(This) ((IAutoComplete2*)&(This)->lpVtbl)
#define _IAutoCompleteDropDown_(This) (&(This)->lpDropDownVtbl)
static
inline
IAutoCompleteImpl
*
impl_from_IAutoComplete2
(
IAutoComplete2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IAutoCompleteImpl
,
IAutoComplete2_iface
);
}
static
inline
IAutoCompleteImpl
*
impl_from_IAutoCompleteDropDown
(
IAutoCompleteDropDown
*
iface
)
{
return
(
IAutoCompleteImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IAutoComplete
Impl
,
lp
DropDown
Vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
IAutoCompleteImpl
,
IAutoCompleteDropDown
_iface
);
}
static
LRESULT
APIENTRY
ACEditSubclassProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
...
...
@@ -134,13 +133,13 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO
return
E_OUTOFMEMORY
;
lpac
->
ref
=
1
;
lpac
->
lpVtbl
=
&
acvt
;
lpac
->
lpDropDown
Vtbl
=
&
acdropdownvt
;
lpac
->
IAutoComplete2_iface
.
lpVtbl
=
&
acvt
;
lpac
->
IAutoCompleteDropDown_iface
.
lp
Vtbl
=
&
acdropdownvt
;
lpac
->
enabled
=
TRUE
;
lpac
->
options
=
ACO_AUTOAPPEND
;
hr
=
I
Unknown
_QueryInterface
(
_IUnknown_
(
lp
ac
)
,
riid
,
ppv
);
I
Unknown_Release
(
_IUnknown_
(
lp
ac
)
);
hr
=
I
AutoComplete2
_QueryInterface
(
&
lpac
->
IAutoComplete2_if
ac
e
,
riid
,
ppv
);
I
AutoComplete2_Release
(
&
lpac
->
IAutoComplete2_if
ac
e
);
TRACE
(
"-- (%p)->
\n
"
,
lpac
);
...
...
@@ -155,8 +154,8 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface(
REFIID
riid
,
LPVOID
*
ppvObj
)
{
IAutoCompleteImpl
*
This
=
(
IAutoComplete
Impl
*
)
iface
;
IAutoCompleteImpl
*
This
=
impl_from_
IAutoComplete
2
(
iface
)
;
TRACE
(
"(%p)->(IID:%s,%p)
\n
"
,
This
,
shdebugstr_guid
(
riid
),
ppvObj
);
*
ppvObj
=
NULL
;
...
...
@@ -168,7 +167,7 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface(
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAutoCompleteDropDown
))
{
*
ppvObj
=
_
IAutoCompleteDropDown_
(
This
)
;
*
ppvObj
=
&
This
->
IAutoCompleteDropDown_
iface
;
}
if
(
*
ppvObj
)
...
...
@@ -187,9 +186,9 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface(
static
ULONG
WINAPI
IAutoComplete2_fnAddRef
(
IAutoComplete2
*
iface
)
{
IAutoCompleteImpl
*
This
=
(
IAutoComplete
Impl
*
)
iface
;
IAutoCompleteImpl
*
This
=
impl_from_
IAutoComplete
2
(
iface
)
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
...
...
@@ -201,7 +200,7 @@ static ULONG WINAPI IAutoComplete2_fnAddRef(
static
ULONG
WINAPI
IAutoComplete2_fnRelease
(
IAutoComplete2
*
iface
)
{
IAutoCompleteImpl
*
This
=
(
IAutoComplete
Impl
*
)
iface
;
IAutoCompleteImpl
*
This
=
impl_from_
IAutoComplete
2
(
iface
)
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
refCount
+
1
);
...
...
@@ -224,8 +223,7 @@ static HRESULT WINAPI IAutoComplete2_fnEnable(
IAutoComplete2
*
iface
,
BOOL
fEnable
)
{
IAutoCompleteImpl
*
This
=
(
IAutoCompleteImpl
*
)
iface
;
IAutoCompleteImpl
*
This
=
impl_from_IAutoComplete2
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
(
fEnable
)
?
"true"
:
"false"
);
...
...
@@ -245,7 +243,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
LPCOLESTR
pwzsRegKeyPath
,
LPCOLESTR
pwszQuickComplete
)
{
IAutoCompleteImpl
*
This
=
(
IAutoComplete
Impl
*
)
iface
;
IAutoCompleteImpl
*
This
=
impl_from_
IAutoComplete
2
(
iface
)
;
TRACE
(
"(%p)->(%p, %p, %s, %s)
\n
"
,
This
,
hwndEdit
,
punkACL
,
debugstr_w
(
pwzsRegKeyPath
),
debugstr_w
(
pwszQuickComplete
));
...
...
@@ -274,7 +272,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
This
->
hwndEdit
=
hwndEdit
;
This
->
wpOrigEditProc
=
(
WNDPROC
)
SetWindowLongPtrW
(
hwndEdit
,
GWLP_WNDPROC
,
(
LONG_PTR
)
ACEditSubclassProc
);
/* Keep at least one reference to the object until the edit window is destroyed. */
IAutoComplete2_AddRef
(
(
IAutoComplete2
*
)
This
);
IAutoComplete2_AddRef
(
&
This
->
IAutoComplete2
_iface
);
SetPropW
(
hwndEdit
,
autocomplete_propertyW
,
This
);
if
(
This
->
options
&
ACO_AUTOSUGGEST
)
...
...
@@ -326,10 +324,9 @@ static HRESULT WINAPI IAutoComplete2_fnGetOptions(
IAutoComplete2
*
iface
,
DWORD
*
pdwFlag
)
{
IAutoCompleteImpl
*
This
=
impl_from_IAutoComplete2
(
iface
);
HRESULT
hr
=
S_OK
;
IAutoCompleteImpl
*
This
=
(
IAutoCompleteImpl
*
)
iface
;
TRACE
(
"(%p) -> (%p)
\n
"
,
This
,
pdwFlag
);
*
pdwFlag
=
This
->
options
;
...
...
@@ -344,10 +341,9 @@ static HRESULT WINAPI IAutoComplete2_fnSetOptions(
IAutoComplete2
*
iface
,
DWORD
dwFlag
)
{
IAutoCompleteImpl
*
This
=
impl_from_IAutoComplete2
(
iface
);
HRESULT
hr
=
S_OK
;
IAutoCompleteImpl
*
This
=
(
IAutoCompleteImpl
*
)
iface
;
TRACE
(
"(%p) -> (0x%x)
\n
"
,
This
,
dwFlag
);
This
->
options
=
dwFlag
;
...
...
@@ -434,19 +430,19 @@ static HRESULT WINAPI IAutoCompleteDropDown_fnQueryInterface(IAutoCompleteDropDo
REFIID
riid
,
LPVOID
*
ppvObj
)
{
IAutoCompleteImpl
*
This
=
impl_from_IAutoCompleteDropDown
(
iface
);
return
IAutoComplete2_fnQueryInterface
(
_
IAutoComplete2_
(
This
)
,
riid
,
ppvObj
);
return
IAutoComplete2_fnQueryInterface
(
&
This
->
IAutoComplete2_
iface
,
riid
,
ppvObj
);
}
static
ULONG
WINAPI
IAutoCompleteDropDown_fnAddRef
(
IAutoCompleteDropDown
*
iface
)
{
IAutoCompleteImpl
*
This
=
impl_from_IAutoCompleteDropDown
(
iface
);
return
IAutoComplete2_fnAddRef
(
_
IAutoComplete2_
(
This
)
);
return
IAutoComplete2_fnAddRef
(
&
This
->
IAutoComplete2_
iface
);
}
static
ULONG
WINAPI
IAutoCompleteDropDown_fnRelease
(
IAutoCompleteDropDown
*
iface
)
{
IAutoCompleteImpl
*
This
=
impl_from_IAutoCompleteDropDown
(
iface
);
return
IAutoComplete2_fnRelease
(
_
IAutoComplete2_
(
This
)
);
return
IAutoComplete2_fnRelease
(
&
This
->
IAutoComplete2_
iface
);
}
/**************************************************************************
...
...
@@ -636,7 +632,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
This
->
hwndEdit
=
NULL
;
if
(
This
->
hwndListBox
)
DestroyWindow
(
This
->
hwndListBox
);
IAutoComplete2_Release
(
(
IAutoComplete2
*
)
This
);
IAutoComplete2_Release
(
&
This
->
IAutoComplete2
_iface
);
return
CallWindowProcW
(
proc
,
hwnd
,
uMsg
,
wParam
,
lParam
);
}
default:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment