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
c1b7a075
Commit
c1b7a075
authored
Jan 08, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Store collection pointer directly in IEnumVARIANT data.
parent
64c93f60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
42 deletions
+24
-42
filesystem.c
dlls/scrrun/filesystem.c
+24
-42
No files found.
dlls/scrrun/filesystem.c
View file @
c1b7a075
...
@@ -38,20 +38,30 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun);
...
@@ -38,20 +38,30 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun);
static
const
WCHAR
bsW
[]
=
{
'\\'
,
0
};
static
const
WCHAR
bsW
[]
=
{
'\\'
,
0
};
struct
foldercollection
{
IFolderCollection
IFolderCollection_iface
;
LONG
ref
;
BSTR
path
;
};
struct
filecollection
{
IFileCollection
IFileCollection_iface
;
LONG
ref
;
BSTR
path
;
};
struct
enumdata
{
struct
enumdata
{
union
union
{
{
struct
struct
{
{
IFolderC
ollection
*
coll
;
struct
folderc
ollection
*
coll
;
HANDLE
find
;
HANDLE
find
;
BSTR
path
;
}
foldercoll
;
}
foldercoll
;
struct
struct
{
{
IFileC
ollection
*
coll
;
struct
filec
ollection
*
coll
;
HANDLE
find
;
HANDLE
find
;
BSTR
path
;
}
filecoll
;
}
filecoll
;
}
u
;
}
u
;
};
};
...
@@ -63,18 +73,6 @@ struct enumvariant {
...
@@ -63,18 +73,6 @@ struct enumvariant {
struct
enumdata
data
;
struct
enumdata
data
;
};
};
struct
foldercollection
{
IFolderCollection
IFolderCollection_iface
;
LONG
ref
;
BSTR
path
;
};
struct
filecollection
{
IFileCollection
IFileCollection_iface
;
LONG
ref
;
BSTR
path
;
};
struct
folder
{
struct
folder
{
IFolder
IFolder_iface
;
IFolder
IFolder_iface
;
LONG
ref
;
LONG
ref
;
...
@@ -459,8 +457,7 @@ static ULONG WINAPI foldercoll_enumvariant_Release(IEnumVARIANT *iface)
...
@@ -459,8 +457,7 @@ static ULONG WINAPI foldercoll_enumvariant_Release(IEnumVARIANT *iface)
if
(
!
ref
)
if
(
!
ref
)
{
{
IFolderCollection_Release
(
This
->
data
.
u
.
foldercoll
.
coll
);
IFolderCollection_Release
(
&
This
->
data
.
u
.
foldercoll
.
coll
->
IFolderCollection_iface
);
SysFreeString
(
This
->
data
.
u
.
foldercoll
.
path
);
FindClose
(
This
->
data
.
u
.
foldercoll
.
find
);
FindClose
(
This
->
data
.
u
.
foldercoll
.
find
);
heap_free
(
This
);
heap_free
(
This
);
}
}
...
@@ -484,7 +481,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
...
@@ -484,7 +481,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
{
{
static
const
WCHAR
allW
[]
=
{
'*'
,
0
};
static
const
WCHAR
allW
[]
=
{
'*'
,
0
};
WCHAR
pathW
[
MAX_PATH
];
WCHAR
pathW
[
MAX_PATH
];
BSTR
parent
=
This
->
data
.
u
.
foldercoll
.
path
;
BSTR
parent
=
This
->
data
.
u
.
foldercoll
.
coll
->
path
;
int
len
;
int
len
;
strcpyW
(
pathW
,
parent
);
strcpyW
(
pathW
,
parent
);
...
@@ -522,7 +519,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
...
@@ -522,7 +519,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
HRESULT
hr
;
HRESULT
hr
;
BSTR
str
;
BSTR
str
;
str
=
get_full_path
(
This
->
data
.
u
.
foldercoll
.
path
,
&
data
);
str
=
get_full_path
(
This
->
data
.
u
.
foldercoll
.
coll
->
path
,
&
data
);
hr
=
create_folder
(
str
,
&
folder
);
hr
=
create_folder
(
str
,
&
folder
);
SysFreeString
(
str
);
SysFreeString
(
str
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
...
@@ -598,15 +595,8 @@ static HRESULT create_foldercoll_enum(struct foldercollection *collection, IUnkn
...
@@ -598,15 +595,8 @@ static HRESULT create_foldercoll_enum(struct foldercollection *collection, IUnkn
This
->
IEnumVARIANT_iface
.
lpVtbl
=
&
foldercollenumvariantvtbl
;
This
->
IEnumVARIANT_iface
.
lpVtbl
=
&
foldercollenumvariantvtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
data
.
u
.
foldercoll
.
find
=
NULL
;
This
->
data
.
u
.
foldercoll
.
find
=
NULL
;
This
->
data
.
u
.
foldercoll
.
path
=
SysAllocString
(
collection
->
path
);
This
->
data
.
u
.
foldercoll
.
coll
=
collection
;
if
(
!
This
->
data
.
u
.
foldercoll
.
path
)
IFolderCollection_AddRef
(
&
collection
->
IFolderCollection_iface
);
{
heap_free
(
This
);
return
E_OUTOFMEMORY
;
}
This
->
data
.
u
.
foldercoll
.
coll
=
&
collection
->
IFolderCollection_iface
;
IFolderCollection_AddRef
(
This
->
data
.
u
.
foldercoll
.
coll
);
*
newenum
=
(
IUnknown
*
)
&
This
->
IEnumVARIANT_iface
;
*
newenum
=
(
IUnknown
*
)
&
This
->
IEnumVARIANT_iface
;
...
@@ -622,8 +612,7 @@ static ULONG WINAPI filecoll_enumvariant_Release(IEnumVARIANT *iface)
...
@@ -622,8 +612,7 @@ static ULONG WINAPI filecoll_enumvariant_Release(IEnumVARIANT *iface)
if
(
!
ref
)
if
(
!
ref
)
{
{
IFileCollection_Release
(
This
->
data
.
u
.
filecoll
.
coll
);
IFileCollection_Release
(
&
This
->
data
.
u
.
filecoll
.
coll
->
IFileCollection_iface
);
SysFreeString
(
This
->
data
.
u
.
filecoll
.
path
);
heap_free
(
This
);
heap_free
(
This
);
}
}
...
@@ -646,7 +635,7 @@ static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt,
...
@@ -646,7 +635,7 @@ static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt,
{
{
static
const
WCHAR
allW
[]
=
{
'*'
,
0
};
static
const
WCHAR
allW
[]
=
{
'*'
,
0
};
WCHAR
pathW
[
MAX_PATH
];
WCHAR
pathW
[
MAX_PATH
];
BSTR
parent
=
This
->
data
.
u
.
filecoll
.
path
;
BSTR
parent
=
This
->
data
.
u
.
filecoll
.
coll
->
path
;
int
len
;
int
len
;
strcpyW
(
pathW
,
parent
);
strcpyW
(
pathW
,
parent
);
...
@@ -683,7 +672,7 @@ static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt,
...
@@ -683,7 +672,7 @@ static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt,
HRESULT
hr
;
HRESULT
hr
;
BSTR
str
;
BSTR
str
;
str
=
get_full_path
(
This
->
data
.
u
.
filecoll
.
path
,
&
data
);
str
=
get_full_path
(
This
->
data
.
u
.
filecoll
.
coll
->
path
,
&
data
);
hr
=
create_file
(
str
,
&
file
);
hr
=
create_file
(
str
,
&
file
);
SysFreeString
(
str
);
SysFreeString
(
str
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
...
@@ -758,15 +747,8 @@ static HRESULT create_filecoll_enum(struct filecollection *collection, IUnknown
...
@@ -758,15 +747,8 @@ static HRESULT create_filecoll_enum(struct filecollection *collection, IUnknown
This
->
IEnumVARIANT_iface
.
lpVtbl
=
&
filecollenumvariantvtbl
;
This
->
IEnumVARIANT_iface
.
lpVtbl
=
&
filecollenumvariantvtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
data
.
u
.
filecoll
.
path
=
SysAllocString
(
collection
->
path
);
This
->
data
.
u
.
filecoll
.
coll
=
collection
;
if
(
!
This
->
data
.
u
.
filecoll
.
path
)
IFileCollection_AddRef
(
&
collection
->
IFileCollection_iface
);
{
heap_free
(
This
);
return
E_OUTOFMEMORY
;
}
This
->
data
.
u
.
filecoll
.
coll
=
&
collection
->
IFileCollection_iface
;
IFileCollection_AddRef
(
This
->
data
.
u
.
filecoll
.
coll
);
*
newenum
=
(
IUnknown
*
)
&
This
->
IEnumVARIANT_iface
;
*
newenum
=
(
IUnknown
*
)
&
This
->
IEnumVARIANT_iface
;
...
...
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