Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
881299c6
Commit
881299c6
authored
Jan 13, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Rearrange code to avoid forward declarations.
parent
88baa9e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
90 deletions
+79
-90
shlfsbind.c
dlls/shell32/shlfsbind.c
+79
-90
No files found.
dlls/shell32/shlfsbind.c
View file @
881299c6
...
...
@@ -44,86 +44,31 @@ typedef struct
IFileSystemBindData
IFileSystemBindData_iface
;
LONG
ref
;
WIN32_FIND_DATAW
findFile
;
}
IFileSystemBindDataImpl
;
}
FileSystemBindData
;
static
inline
IFileSystemBindDataImpl
*
impl_from_IFileSystemBindData
(
IFileSystemBindData
*
iface
)
static
inline
FileSystemBindData
*
impl_from_IFileSystemBindData
(
IFileSystemBindData
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IFileSystemBindDataImpl
,
IFileSystemBindData_iface
);
return
CONTAINING_RECORD
(
iface
,
FileSystemBindData
,
IFileSystemBindData_iface
);
}
static
HRESULT
WINAPI
IFileSystemBindData_fnQueryInterface
(
IFileSystemBindData
*
,
REFIID
,
LPVOID
*
);
static
ULONG
WINAPI
IFileSystemBindData_fnAddRef
(
IFileSystemBindData
*
);
static
ULONG
WINAPI
IFileSystemBindData_fnRelease
(
IFileSystemBindData
*
);
static
HRESULT
WINAPI
IFileSystemBindData_fnGetFindData
(
IFileSystemBindData
*
,
WIN32_FIND_DATAW
*
);
static
HRESULT
WINAPI
IFileSystemBindData_fnSetFindData
(
IFileSystemBindData
*
,
const
WIN32_FIND_DATAW
*
);
static
const
IFileSystemBindDataVtbl
sbvt
=
{
IFileSystemBindData_fnQueryInterface
,
IFileSystemBindData_fnAddRef
,
IFileSystemBindData_fnRelease
,
IFileSystemBindData_fnSetFindData
,
IFileSystemBindData_fnGetFindData
,
};
static
const
WCHAR
wFileSystemBindData
[]
=
{
'F'
,
'i'
,
'l'
,
'e'
,
' '
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
' '
,
'B'
,
'i'
,
'n'
,
'd'
,
' '
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
HRESULT
WINAPI
IFileSystemBindData_Constructor
(
const
WIN32_FIND_DATAW
*
pfd
,
LPBC
*
ppV
)
static
HRESULT
WINAPI
FileSystemBindData_QueryInterface
(
IFileSystemBindData
*
iface
,
REFIID
riid
,
LPVOID
*
ppV
)
{
IFileSystemBindDataImpl
*
sb
;
HRESULT
ret
=
E_OUTOFMEMORY
;
TRACE
(
"%p, %p
\n
"
,
pfd
,
ppV
);
FileSystemBindData
*
This
=
impl_from_IFileSystemBindData
(
iface
);
if
(
!
ppV
)
return
E_INVALIDARG
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppV
);
*
ppV
=
NULL
;
sb
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IFileSystemBindDataImpl
));
if
(
!
sb
)
return
ret
;
sb
->
IFileSystemBindData_iface
.
lpVtbl
=
&
sbvt
;
sb
->
ref
=
1
;
IFileSystemBindData_fnSetFindData
(
&
sb
->
IFileSystemBindData_iface
,
pfd
);
ret
=
CreateBindCtx
(
0
,
ppV
);
if
(
SUCCEEDED
(
ret
))
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IFileSystemBindData
))
{
BIND_OPTS
bindOpts
;
bindOpts
.
cbStruct
=
sizeof
(
BIND_OPTS
);
bindOpts
.
grfFlags
=
0
;
bindOpts
.
grfMode
=
STGM_CREATE
;
bindOpts
.
dwTickCountDeadline
=
0
;
IBindCtx_SetBindOptions
(
*
ppV
,
&
bindOpts
);
IBindCtx_RegisterObjectParam
(
*
ppV
,
(
LPOLESTR
)
wFileSystemBindData
,
(
LPUNKNOWN
)
sb
);
IFileSystemBindData_Release
(
&
sb
->
IFileSystemBindData_iface
);
*
ppV
=
&
This
->
IFileSystemBindData_iface
;
}
else
HeapFree
(
GetProcessHeap
(),
0
,
sb
);
return
ret
;
}
static
HRESULT
WINAPI
IFileSystemBindData_fnQueryInterface
(
IFileSystemBindData
*
iface
,
REFIID
riid
,
LPVOID
*
ppV
)
{
IFileSystemBindDataImpl
*
This
=
impl_from_IFileSystemBindData
(
iface
);
TRACE
(
"(%p)->(
\n\t
IID:
\t
%s, %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppV
);
*
ppV
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ppV
=
This
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IFileSystemBindData
))
*
ppV
=
This
;
if
(
*
ppV
)
{
I
Unknown_AddRef
((
IUnknown
*
)(
*
ppV
)
);
I
FileSystemBindData_AddRef
(
iface
);
TRACE
(
"-- Interface: (%p)->(%p)
\n
"
,
ppV
,
*
ppV
);
return
S_OK
;
}
...
...
@@ -131,36 +76,32 @@ static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IFileSystemBindData_fn
AddRef
(
IFileSystemBindData
*
iface
)
static
ULONG
WINAPI
FileSystemBindData_
AddRef
(
IFileSystemBindData
*
iface
)
{
IFileSystemBindDataImpl
*
This
=
impl_from_IFileSystemBindData
(
iface
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(count=%i)
\n
"
,
This
,
refCount
-
1
);
return
refCount
;
FileSystemBindData
*
This
=
impl_from_IFileSystemBindData
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IFileSystemBindData_fn
Release
(
IFileSystemBindData
*
iface
)
static
ULONG
WINAPI
FileSystemBindData_
Release
(
IFileSystemBindData
*
iface
)
{
IFileSystemBindDataImpl
*
This
=
impl_from_IFileSystemBindData
(
iface
);
ULONG
ref
Count
=
InterlockedDecrement
(
&
This
->
ref
);
FileSystemBindData
*
This
=
impl_from_IFileSystemBindData
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(
count=%i)
\n
"
,
This
,
refCount
+
1
);
TRACE
(
"(%p)->(
%u)
\n
"
,
This
,
ref
);
if
(
!
refCount
)
{
TRACE
(
" destroying ISFBindPidl(%p)
\n
"
,
This
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
Count
;
return
ref
;
}
static
HRESULT
WINAPI
IFileSystemBindData_fnGetFindData
(
IFileSystemBindData
*
iface
,
WIN32_FIND_DATAW
*
pfd
)
static
HRESULT
WINAPI
FileSystemBindData_GetFindData
(
IFileSystemBindData
*
iface
,
WIN32_FIND_DATAW
*
pfd
)
{
IFileSystemBindDataImpl
*
This
=
impl_from_IFileSystemBindData
(
iface
);
TRACE
(
"(%p), %p
\n
"
,
This
,
pfd
);
FileSystemBindData
*
This
=
impl_from_IFileSystemBindData
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pfd
);
if
(
!
pfd
)
return
E_INVALIDARG
;
...
...
@@ -169,11 +110,11 @@ static HRESULT WINAPI IFileSystemBindData_fnGetFindData(
return
S_OK
;
}
static
HRESULT
WINAPI
IFileSystemBindData_fnSetFindData
(
IFileSystemBindData
*
iface
,
const
WIN32_FIND_DATAW
*
pfd
)
static
HRESULT
WINAPI
FileSystemBindData_SetFindData
(
IFileSystemBindData
*
iface
,
const
WIN32_FIND_DATAW
*
pfd
)
{
IFileSystemBindDataImpl
*
This
=
impl_from_IFileSystemBindData
(
iface
);
TRACE
(
"(%p), %p
\n
"
,
This
,
pfd
);
FileSystemBindData
*
This
=
impl_from_IFileSystemBindData
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pfd
);
if
(
pfd
)
This
->
findFile
=
*
pfd
;
...
...
@@ -181,3 +122,51 @@ static HRESULT WINAPI IFileSystemBindData_fnSetFindData(
memset
(
&
This
->
findFile
,
0
,
sizeof
(
WIN32_FIND_DATAW
));
return
S_OK
;
}
static
const
IFileSystemBindDataVtbl
FileSystemBindDataVtbl
=
{
FileSystemBindData_QueryInterface
,
FileSystemBindData_AddRef
,
FileSystemBindData_Release
,
FileSystemBindData_SetFindData
,
FileSystemBindData_GetFindData
,
};
HRESULT
WINAPI
IFileSystemBindData_Constructor
(
const
WIN32_FIND_DATAW
*
find_data
,
LPBC
*
ppV
)
{
FileSystemBindData
*
This
;
HRESULT
ret
;
TRACE
(
"(%p %p)
\n
"
,
find_data
,
ppV
);
if
(
!
ppV
)
return
E_INVALIDARG
;
*
ppV
=
NULL
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IFileSystemBindData_iface
.
lpVtbl
=
&
FileSystemBindDataVtbl
;
This
->
ref
=
1
;
IFileSystemBindData_SetFindData
(
&
This
->
IFileSystemBindData_iface
,
find_data
);
ret
=
CreateBindCtx
(
0
,
ppV
);
if
(
SUCCEEDED
(
ret
))
{
static
const
WCHAR
nameW
[]
=
{
'F'
,
'i'
,
'l'
,
'e'
,
' '
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
' '
,
'B'
,
'i'
,
'n'
,
'd'
,
' '
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
BIND_OPTS
bindOpts
;
bindOpts
.
cbStruct
=
sizeof
(
BIND_OPTS
);
bindOpts
.
grfFlags
=
0
;
bindOpts
.
grfMode
=
STGM_CREATE
;
bindOpts
.
dwTickCountDeadline
=
0
;
IBindCtx_SetBindOptions
(
*
ppV
,
&
bindOpts
);
IBindCtx_RegisterObjectParam
(
*
ppV
,
(
WCHAR
*
)
nameW
,
(
IUnknown
*
)
&
This
->
IFileSystemBindData_iface
);
IFileSystemBindData_Release
(
&
This
->
IFileSystemBindData_iface
);
}
else
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ret
;
}
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