mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 09:53:38 +00:00
scrrun: Store full path in folder object.
This commit is contained in:
parent
4e360e8d42
commit
97b83a6dec
|
@ -2699,6 +2699,7 @@ static const IFolderVtbl foldervtbl = {
|
||||||
HRESULT create_folder(const WCHAR *path, IFolder **folder)
|
HRESULT create_folder(const WCHAR *path, IFolder **folder)
|
||||||
{
|
{
|
||||||
struct folder *object;
|
struct folder *object;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
*folder = NULL;
|
*folder = NULL;
|
||||||
|
|
||||||
|
@ -2709,13 +2710,28 @@ HRESULT create_folder(const WCHAR *path, IFolder **folder)
|
||||||
|
|
||||||
object->IFolder_iface.lpVtbl = &foldervtbl;
|
object->IFolder_iface.lpVtbl = &foldervtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
object->path = SysAllocString(path);
|
|
||||||
if (!object->path)
|
len = GetFullPathNameW(path, 0, NULL, NULL);
|
||||||
|
if (!len)
|
||||||
|
{
|
||||||
|
free(object);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
object->path = SysAllocStringLen(NULL, len);
|
||||||
|
if(!object->path)
|
||||||
{
|
{
|
||||||
free(object);
|
free(object);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!GetFullPathNameW(path, len, object->path, NULL))
|
||||||
|
{
|
||||||
|
SysFreeString(object->path);
|
||||||
|
free(object);
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
init_classinfo(&CLSID_Folder, (IUnknown *)&object->IFolder_iface, &object->classinfo);
|
init_classinfo(&CLSID_Folder, (IUnknown *)&object->IFolder_iface, &object->classinfo);
|
||||||
*folder = &object->IFolder_iface;
|
*folder = &object->IFolder_iface;
|
||||||
|
|
||||||
|
|
|
@ -973,7 +973,7 @@ static void test_GetFolder(void)
|
||||||
SysFreeString(str);
|
SysFreeString(str);
|
||||||
hr = IFolder_get_Path(folder, &str);
|
hr = IFolder_get_Path(folder, &str);
|
||||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||||
todo_wine ok(!PathIsRelativeW(str), "path %s is relative.\n", wine_dbgstr_w(str));
|
ok(!PathIsRelativeW(str), "path %s is relative.\n", wine_dbgstr_w(str));
|
||||||
SysFreeString(str);
|
SysFreeString(str);
|
||||||
IFolder_Release(folder);
|
IFolder_Release(folder);
|
||||||
RemoveDirectoryW(dir);
|
RemoveDirectoryW(dir);
|
||||||
|
|
Loading…
Reference in a new issue