taskschd: Do not return ERROR_* constant in HRESULT function.

Sebastian Lackner sebastian at fds-team.de
Tue Sep 13 10:46:10 CDT 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

.../dlls/taskschd/folder.c:420:43: warning: Returning type 'int' in function with HRESULT return type [wine-hresult-check]
        if (len && path[len - 1] == '\\') return ERROR_INVALID_NAME;

 dlls/taskschd/folder.c          |    2 +-
 dlls/taskschd/tests/scheduler.c |    2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/taskschd/folder.c b/dlls/taskschd/folder.c
index c0eb1fb..26993ca 100644
--- a/dlls/taskschd/folder.c
+++ b/dlls/taskschd/folder.c
@@ -417,7 +417,7 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
     if (path)
     {
         int len = strlenW(path);
-        if (len && path[len - 1] == '\\') return ERROR_INVALID_NAME;
+        if (len && path[len - 1] == '\\') return HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
     }
 
     folder_path = get_full_path(parent, path);
diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c
index 20f8845..4976f4c 100644
--- a/dlls/taskschd/tests/scheduler.c
+++ b/dlls/taskschd/tests/scheduler.c
@@ -217,7 +217,6 @@ todo_wine
     ok(hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), "expected ERROR_ALREADY_EXISTS, got %#x\n", hr);
 
     hr = ITaskFolder_CreateFolder(folder, Wine_Folder1_, v_null, &subfolder);
-todo_wine
     ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
 
     hr = ITaskFolder_CreateFolder(folder, Wine, v_null, &subfolder);
@@ -297,7 +296,6 @@ todo_wine
     SysFreeString(bstr);
 
     hr = ITaskFolder_GetFolder(subfolder, bslash, &subfolder2);
-todo_wine
     ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
 
     hr = ITaskFolder_GetFolder(subfolder, NULL, &subfolder2);
-- 
2.9.0



More information about the wine-patches mailing list