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
fab963cd
Commit
fab963cd
authored
Jul 23, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Add IFileSystem3::GetFileName implementation.
parent
d51a35c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
2 deletions
+73
-2
filesystem.c
dlls/scrrun/filesystem.c
+29
-2
filesystem.c
dlls/scrrun/tests/filesystem.c
+44
-0
No files found.
dlls/scrrun/filesystem.c
View file @
fab963cd
...
...
@@ -780,9 +780,36 @@ static HRESULT WINAPI filesys_GetParentFolderName(IFileSystem3 *iface, BSTR Path
static
HRESULT
WINAPI
filesys_GetFileName
(
IFileSystem3
*
iface
,
BSTR
Path
,
BSTR
*
pbstrResult
)
{
FIXME
(
"%p %s %p
\n
"
,
iface
,
debugstr_w
(
Path
),
pbstrResult
)
;
int
i
,
end
;
return
E_NOTIMPL
;
TRACE
(
"%p %s %p
\n
"
,
iface
,
debugstr_w
(
Path
),
pbstrResult
);
if
(
!
pbstrResult
)
return
E_POINTER
;
if
(
!
Path
)
{
*
pbstrResult
=
NULL
;
return
S_OK
;
}
for
(
end
=
strlenW
(
Path
)
-
1
;
end
>=
0
;
end
--
)
if
(
Path
[
end
]
!=
'/'
&&
Path
[
end
]
!=
'\\'
)
break
;
for
(
i
=
end
;
i
>=
0
;
i
--
)
if
(
Path
[
i
]
==
'/'
||
Path
[
i
]
==
'\\'
)
break
;
i
++
;
if
(
i
>
end
||
(
i
==
0
&&
end
==
1
&&
Path
[
1
]
==
':'
))
{
*
pbstrResult
=
NULL
;
return
S_OK
;
}
*
pbstrResult
=
SysAllocStringLen
(
Path
+
i
,
end
-
i
+
1
);
if
(
!*
pbstrResult
)
return
E_OUTOFMEMORY
;
return
S_OK
;
}
static
HRESULT
WINAPI
filesys_GetBaseName
(
IFileSystem3
*
iface
,
BSTR
Path
,
...
...
dlls/scrrun/tests/filesystem.c
View file @
fab963cd
...
...
@@ -302,6 +302,49 @@ static void test_GetParentFolderName(void)
}
}
static
void
test_GetFileName
(
void
)
{
static
const
WCHAR
path1
[]
=
{
'a'
,
0
};
static
const
WCHAR
path2
[]
=
{
'a'
,
'/'
,
'a'
,
'.'
,
'b'
,
0
};
static
const
WCHAR
path3
[]
=
{
'a'
,
'\\'
,
0
};
static
const
WCHAR
path4
[]
=
{
'c'
,
':'
,
0
};
static
const
WCHAR
path5
[]
=
{
'/'
,
'\\'
,
0
};
static
const
WCHAR
result2
[]
=
{
'a'
,
'.'
,
'b'
,
0
};
static
const
WCHAR
result3
[]
=
{
'a'
,
0
};
static
const
struct
{
const
WCHAR
*
path
;
const
WCHAR
*
result
;
}
tests
[]
=
{
{
NULL
,
NULL
},
{
path1
,
path1
},
{
path2
,
result2
},
{
path3
,
result3
},
{
path4
,
NULL
},
{
path5
,
NULL
}
};
BSTR
path
,
result
;
HRESULT
hr
;
int
i
;
hr
=
IFileSystem3_GetFileName
(
fs3
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetFileName returned %x, expected E_POINTER
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
result
=
(
BSTR
)
0xdeadbeef
;
path
=
tests
[
i
].
path
?
SysAllocString
(
tests
[
i
].
path
)
:
NULL
;
hr
=
IFileSystem3_GetFileName
(
fs3
,
path
,
&
result
);
ok
(
hr
==
S_OK
,
"%d) GetFileName returned %x, expected S_OK
\n
"
,
i
,
hr
);
if
(
!
tests
[
i
].
result
)
ok
(
!
result
,
"%d) result = %s
\n
"
,
i
,
wine_dbgstr_w
(
result
));
else
ok
(
!
lstrcmpW
(
result
,
tests
[
i
].
result
),
"%d) result = %s
\n
"
,
i
,
wine_dbgstr_w
(
result
));
SysFreeString
(
path
);
SysFreeString
(
result
);
}
}
START_TEST
(
filesystem
)
{
HRESULT
hr
;
...
...
@@ -320,6 +363,7 @@ START_TEST(filesystem)
test_textstream
();
test_GetFileVersion
();
test_GetParentFolderName
();
test_GetFileName
();
IFileSystem3_Release
(
fs3
);
...
...
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