Commit 0a190487 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

scrrun: Implement ITextStream Close.

parent bd7e83f2
......@@ -633,8 +633,16 @@ static HRESULT WINAPI textstream_SkipLine(ITextStream *iface)
static HRESULT WINAPI textstream_Close(ITextStream *iface)
{
struct textstream *This = impl_from_ITextStream(iface);
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
HRESULT hr = S_OK;
TRACE("(%p)\n", This);
if(!CloseHandle(This->file))
hr = S_FALSE;
This->file = NULL;
return hr;
}
static const ITextStreamVtbl textstreamvtbl = {
......
......@@ -35,6 +35,9 @@
static IFileSystem3 *fs3;
/* w2k and 2k3 error code. */
#define E_VAR_NOT_SET 0x800a005b
static inline ULONG get_refcount(IUnknown *iface)
{
IUnknown_AddRef(iface);
......@@ -1378,6 +1381,15 @@ static void test_CreateTextFile(void)
hr = ITextStream_Read(stream, 1, &str);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
hr = ITextStream_Close(stream);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = ITextStream_Read(stream, 1, &str);
ok(hr == CTL_E_BADFILEMODE || hr == E_VAR_NOT_SET, "got 0x%08x\n", hr);
hr = ITextStream_Close(stream);
ok(hr == S_FALSE || hr == E_VAR_NOT_SET, "got 0x%08x\n", hr);
ITextStream_Release(stream);
/* check it's created */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment