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
c7abcd74
Commit
c7abcd74
authored
Jul 30, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Add IFile::get_Size implementation.
parent
4135874f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
filesystem.c
dlls/scrrun/filesystem.c
+22
-2
filesystem.c
dlls/scrrun/tests/filesystem.c
+6
-0
No files found.
dlls/scrrun/filesystem.c
View file @
c7abcd74
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include <stdarg.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -824,8 +825,27 @@ static HRESULT WINAPI file_get_DateLastAccessed(IFile *iface, DATE *pdate)
static
HRESULT
WINAPI
file_get_Size
(
IFile
*
iface
,
VARIANT
*
pvarSize
)
{
struct
file
*
This
=
impl_from_IFile
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pvarSize
);
return
E_NOTIMPL
;
WIN32_FIND_DATAW
fd
;
HANDLE
f
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pvarSize
);
if
(
!
pvarSize
)
return
E_POINTER
;
f
=
FindFirstFileW
(
This
->
path
,
&
fd
);
if
(
f
==
INVALID_HANDLE_VALUE
)
return
create_error
(
GetLastError
());
FindClose
(
f
);
if
(
fd
.
nFileSizeHigh
||
fd
.
nFileSizeLow
>
INT_MAX
)
{
V_VT
(
pvarSize
)
=
VT_R8
;
V_R8
(
pvarSize
)
=
((
ULONGLONG
)
fd
.
nFileSizeHigh
<<
32
)
+
fd
.
nFileSizeLow
;
}
else
{
V_VT
(
pvarSize
)
=
VT_I4
;
V_I4
(
pvarSize
)
=
fd
.
nFileSizeLow
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
file_get_Type
(
IFile
*
iface
,
BSTR
*
pbstrType
)
...
...
dlls/scrrun/tests/filesystem.c
View file @
c7abcd74
...
...
@@ -467,6 +467,7 @@ static void test_GetFile(void)
BSTR
path
=
SysAllocString
(
get_file
);
FileAttribute
fa
;
VARIANT
size
;
DWORD
gfa
;
IFile
*
file
;
HRESULT
hr
;
...
...
@@ -505,6 +506,11 @@ static void test_GetFile(void)
gfa
=
GetFileAttributesW
(
get_file
)
&
~
FILE_ATTRIBUTE_NORMAL
;
ok
(
hr
==
S_OK
,
"get_Attributes returned %x, expected S_OK
\n
"
,
hr
);
ok
(
fa
==
gfa
,
"fa = %x, expected %x
\n
"
,
fa
,
gfa
);
hr
=
IFile_get_Size
(
file
,
&
size
);
ok
(
hr
==
S_OK
,
"get_Size returned %x, expected S_OK
\n
"
,
hr
);
ok
(
V_VT
(
&
size
)
==
VT_I4
,
"V_VT(&size) = %d, expected VT_I4
\n
"
,
V_VT
(
&
size
));
ok
(
V_I4
(
&
size
)
==
0
,
"V_I4(&size) = %d, expected 0
\n
"
,
V_I4
(
&
size
));
IFile_Release
(
file
);
DeleteFileW
(
path
);
...
...
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