msado15: Implement _Stream_put_Type and _Stream_get_Type.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e54fc1a2de
commit
2bca8eac3a
|
@ -20585,6 +20585,7 @@ wine_fn_config_makefile dlls/msacm32.drv enable_msacm32_drv
|
|||
wine_fn_config_makefile dlls/msacm32 enable_msacm32
|
||||
wine_fn_config_makefile dlls/msacm32/tests enable_tests
|
||||
wine_fn_config_makefile dlls/msado15 enable_msado15
|
||||
wine_fn_config_makefile dlls/msado15/tests enable_tests
|
||||
wine_fn_config_makefile dlls/msadp32.acm enable_msadp32_acm
|
||||
wine_fn_config_makefile dlls/msasn1 enable_msasn1
|
||||
wine_fn_config_makefile dlls/mscat32 enable_mscat32
|
||||
|
|
|
@ -3439,6 +3439,7 @@ WINE_CONFIG_MAKEFILE(dlls/msacm32.drv)
|
|||
WINE_CONFIG_MAKEFILE(dlls/msacm32)
|
||||
WINE_CONFIG_MAKEFILE(dlls/msacm32/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/msado15)
|
||||
WINE_CONFIG_MAKEFILE(dlls/msado15/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/msadp32.acm)
|
||||
WINE_CONFIG_MAKEFILE(dlls/msasn1)
|
||||
WINE_CONFIG_MAKEFILE(dlls/mscat32)
|
||||
|
|
|
@ -34,6 +34,7 @@ struct stream
|
|||
{
|
||||
_Stream Stream_iface;
|
||||
LONG refs;
|
||||
StreamTypeEnum type;
|
||||
};
|
||||
|
||||
static inline struct stream *impl_from_Stream( _Stream *iface )
|
||||
|
@ -130,14 +131,20 @@ static HRESULT WINAPI stream_put_Position( _Stream *iface, LONG pos )
|
|||
|
||||
static HRESULT WINAPI stream_get_Type( _Stream *iface, StreamTypeEnum *type )
|
||||
{
|
||||
FIXME( "%p, %p\n", iface, type );
|
||||
return E_NOTIMPL;
|
||||
struct stream *stream = impl_from_Stream( iface );
|
||||
TRACE( "%p, %p\n", stream, type );
|
||||
|
||||
*type = stream->type;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI stream_put_Type( _Stream *iface, StreamTypeEnum type )
|
||||
{
|
||||
FIXME( "%p, %u\n", iface, type );
|
||||
return E_NOTIMPL;
|
||||
struct stream *stream = impl_from_Stream( iface );
|
||||
TRACE( "%p, %u\n", stream, type );
|
||||
|
||||
stream->type = type;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI stream_get_LineSeparator( _Stream *iface, LineSeparatorEnum *sep )
|
||||
|
@ -305,6 +312,7 @@ HRESULT Stream_create( void **obj )
|
|||
if (!(stream = heap_alloc_zero( sizeof(*stream) ))) return E_OUTOFMEMORY;
|
||||
stream->Stream_iface.lpVtbl = &stream_vtbl;
|
||||
stream->refs = 1;
|
||||
stream->type = adTypeText;
|
||||
|
||||
*obj = &stream->Stream_iface;
|
||||
TRACE( "returning iface %p\n", *obj );
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
TESTDLL = msado15.dll
|
||||
IMPORTS = oleaut32 ole32
|
||||
|
||||
C_SRCS = \
|
||||
msado15.c
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright 2019 Hans Leidekker for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#define COBJMACROS
|
||||
#include <initguid.h>
|
||||
#include <oledb.h>
|
||||
#include <msado15_backcompat.h>
|
||||
#include "wine/test.h"
|
||||
|
||||
static void test_Stream(void)
|
||||
{
|
||||
_Stream *stream;
|
||||
StreamTypeEnum type;
|
||||
LONG refs;
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoCreateInstance( &CLSID_Stream, NULL, CLSCTX_INPROC_SERVER, &IID__Stream, (void **)&stream );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
/* check default type */
|
||||
type = 0;
|
||||
hr = _Stream_get_Type( stream, &type );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( type == adTypeText, "got %u\n", type );
|
||||
|
||||
hr = _Stream_put_Type( stream, adTypeBinary );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
type = 0;
|
||||
hr = _Stream_get_Type( stream, &type );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( type == adTypeBinary, "got %u\n", type );
|
||||
|
||||
/* revert */
|
||||
hr = _Stream_put_Type( stream, adTypeText );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
refs = _Stream_Release( stream );
|
||||
ok( !refs, "got %d\n", refs );
|
||||
}
|
||||
|
||||
START_TEST(msado15)
|
||||
{
|
||||
CoInitialize( NULL );
|
||||
test_Stream();
|
||||
CoUninitialize();
|
||||
}
|
Loading…
Reference in New Issue