[1/2] shlwapi: Fixed the todo blocks in the SHCreateStreamOnFile tests. [try 2]

Alexandre Julliard julliard at winehq.org
Mon Apr 14 14:00:47 CDT 2008


"Reece Dunn" <msclrhd at googlemail.com> writes:

> @@ -120,12 +119,12 @@ static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG*
>    TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbRead);
>  
>    if (!pv)
> -    return STG_E_INVALIDPOINTER;
> +    return S_OK;

It's very unlikely that this is the correct behavior in all cases.

> @@ -459,7 +458,9 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
>    switch(STGM_CREATE_MODE(dwMode))
>    {
>    case STGM_FAILIFTHERE:
> -    dwCreate = OPEN_EXISTING;
> +    if (bCreate && PathFileExistsW(lpszPath))
> +      return HRESULT_FROM_WIN32(ERROR_FILE_EXISTS);
> +    dwCreate = bCreate ? CREATE_ALWAYS : OPEN_EXISTING;

That case should be handled by CreateFile, you shouldn't check for the
file existence explicitly.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list