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:
Hans Leidekker 2019-12-06 14:54:21 +01:00 committed by Alexandre Julliard
parent e54fc1a2de
commit 2bca8eac3a
5 changed files with 84 additions and 6 deletions

1
configure vendored
View File

@ -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 enable_msacm32
wine_fn_config_makefile dlls/msacm32/tests enable_tests wine_fn_config_makefile dlls/msacm32/tests enable_tests
wine_fn_config_makefile dlls/msado15 enable_msado15 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/msadp32.acm enable_msadp32_acm
wine_fn_config_makefile dlls/msasn1 enable_msasn1 wine_fn_config_makefile dlls/msasn1 enable_msasn1
wine_fn_config_makefile dlls/mscat32 enable_mscat32 wine_fn_config_makefile dlls/mscat32 enable_mscat32

View File

@ -3439,6 +3439,7 @@ WINE_CONFIG_MAKEFILE(dlls/msacm32.drv)
WINE_CONFIG_MAKEFILE(dlls/msacm32) WINE_CONFIG_MAKEFILE(dlls/msacm32)
WINE_CONFIG_MAKEFILE(dlls/msacm32/tests) WINE_CONFIG_MAKEFILE(dlls/msacm32/tests)
WINE_CONFIG_MAKEFILE(dlls/msado15) WINE_CONFIG_MAKEFILE(dlls/msado15)
WINE_CONFIG_MAKEFILE(dlls/msado15/tests)
WINE_CONFIG_MAKEFILE(dlls/msadp32.acm) WINE_CONFIG_MAKEFILE(dlls/msadp32.acm)
WINE_CONFIG_MAKEFILE(dlls/msasn1) WINE_CONFIG_MAKEFILE(dlls/msasn1)
WINE_CONFIG_MAKEFILE(dlls/mscat32) WINE_CONFIG_MAKEFILE(dlls/mscat32)

View File

@ -34,6 +34,7 @@ struct stream
{ {
_Stream Stream_iface; _Stream Stream_iface;
LONG refs; LONG refs;
StreamTypeEnum type;
}; };
static inline struct stream *impl_from_Stream( _Stream *iface ) 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 ) static HRESULT WINAPI stream_get_Type( _Stream *iface, StreamTypeEnum *type )
{ {
FIXME( "%p, %p\n", iface, type ); struct stream *stream = impl_from_Stream( iface );
return E_NOTIMPL; TRACE( "%p, %p\n", stream, type );
*type = stream->type;
return S_OK;
} }
static HRESULT WINAPI stream_put_Type( _Stream *iface, StreamTypeEnum type ) static HRESULT WINAPI stream_put_Type( _Stream *iface, StreamTypeEnum type )
{ {
FIXME( "%p, %u\n", iface, type ); struct stream *stream = impl_from_Stream( iface );
return E_NOTIMPL; TRACE( "%p, %u\n", stream, type );
stream->type = type;
return S_OK;
} }
static HRESULT WINAPI stream_get_LineSeparator( _Stream *iface, LineSeparatorEnum *sep ) 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; if (!(stream = heap_alloc_zero( sizeof(*stream) ))) return E_OUTOFMEMORY;
stream->Stream_iface.lpVtbl = &stream_vtbl; stream->Stream_iface.lpVtbl = &stream_vtbl;
stream->refs = 1; stream->refs = 1;
stream->type = adTypeText;
*obj = &stream->Stream_iface; *obj = &stream->Stream_iface;
TRACE( "returning iface %p\n", *obj ); TRACE( "returning iface %p\n", *obj );

View File

@ -0,0 +1,5 @@
TESTDLL = msado15.dll
IMPORTS = oleaut32 ole32
C_SRCS = \
msado15.c

View File

@ -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();
}