schedsvc: Return correct error code when a being loaded xml doesn't exist.
This commit is contained in:
parent
4fca169301
commit
96452fc810
|
@ -245,10 +245,16 @@ static int detect_encoding(const void *buffer, DWORD size)
|
|||
static HRESULT read_xml(const WCHAR *name, WCHAR **xml)
|
||||
{
|
||||
HANDLE hfile;
|
||||
DWORD size;
|
||||
DWORD size, attrs;
|
||||
char *src;
|
||||
int cp;
|
||||
|
||||
attrs = GetFileAttributesW(name);
|
||||
if (attrs == INVALID_FILE_ATTRIBUTES)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
if (attrs & FILE_ATTRIBUTE_DIRECTORY)
|
||||
return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND);
|
||||
|
||||
hfile = CreateFileW(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
|
||||
if (hfile == INVALID_HANDLE_VALUE)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
|
|
@ -760,7 +760,6 @@ static void test_GetTask(void)
|
|||
ok(hr == S_OK, "CreateFolder error %#x\n", hr);
|
||||
|
||||
hr = ITaskFolder_GetTask(root, Wine, &task1);
|
||||
todo_wine
|
||||
ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "expected ERROR_PATH_NOT_FOUND, got %#x\n", hr);
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, xml1, -1, xmlW, sizeof(xmlW)/sizeof(xmlW[0]));
|
||||
|
|
Loading…
Reference in New Issue