inetcomm: Add a stub MimeInternational object.

This commit is contained in:
Huw Davies 2008-09-10 12:05:37 +01:00 committed by Alexandre Julliard
parent da95db8d5b
commit d1601eeeac
7 changed files with 254 additions and 2 deletions

View File

@ -9,6 +9,7 @@ IMPORTS = uuid ole32 ws2_32 user32 advapi32 kernel32
C_SRCS = \
inetcomm_main.c \
internettransport.c \
mimeintl.c \
mimeole.c \
regsvr.c

View File

@ -76,7 +76,7 @@
@ stub MimeOleGetFileExtension
@ stub MimeOleGetFileInfo
@ stub MimeOleGetFileInfoW
@ stub MimeOleGetInternat
@ stdcall MimeOleGetInternat(ptr)
@ stub MimeOleGetPropA
@ stub MimeOleGetPropW
@ stub MimeOleGetPropertySchema

View File

@ -37,6 +37,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(inetcomm);
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
IMimeInternational *international;
TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
switch (fdwReason)
@ -47,8 +49,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
DisableThreadLibraryCalls(hinstDLL);
if (!InternetTransport_RegisterClass(hinstDLL))
return FALSE;
MimeInternational_Construct(&international);
break;
case DLL_PROCESS_DETACH:
IMimeInternational_Release(international);
InternetTransport_UnregisterClass(hinstDLL);
break;
default:

View File

@ -71,3 +71,5 @@ void InternetTransport_UnregisterClass(HINSTANCE hInstance);
HRESULT MimeBody_create(IUnknown *outer, void **obj);
HRESULT MimeAllocator_create(IUnknown *outer, void **obj);
HRESULT MimeInternational_Construct(IMimeInternational **internat);

View File

@ -26,8 +26,12 @@
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "winuser.h"
#include "winsock2.h"
#include "ws2tcpip.h"
#include "objbase.h"
#include "ole2.h"
#include "mimeole.h"
#include "wine/debug.h"

241
dlls/inetcomm/mimeintl.c Normal file
View File

@ -0,0 +1,241 @@
/*
* MIME OLE International interface
*
* Copyright 2008 Huw Davies 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
*/
#define COBJMACROS
#define NONAMELESSUNION
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "objbase.h"
#include "ole2.h"
#include "mimeole.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "inetcomm_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(inetcomm);
typedef struct
{
const IMimeInternationalVtbl *lpVtbl;
LONG refs;
} internat;
static inline internat *impl_from_IMimeInternational( IMimeInternational *iface )
{
return (internat *)((char*)iface - FIELD_OFFSET(internat, lpVtbl));
}
static HRESULT WINAPI MimeInternat_QueryInterface( IMimeInternational *iface, REFIID riid, LPVOID *ppobj )
{
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IMimeInternational))
{
IMimeInternational_AddRef( iface );
*ppobj = iface;
return S_OK;
}
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI MimeInternat_AddRef( IMimeInternational *iface )
{
internat *This = impl_from_IMimeInternational( iface );
return InterlockedIncrement(&This->refs);
}
static ULONG WINAPI MimeInternat_Release( IMimeInternational *iface )
{
internat *This = impl_from_IMimeInternational( iface );
ULONG refs;
refs = InterlockedDecrement(&This->refs);
if (!refs)
{
HeapFree(GetProcessHeap(), 0, This);
}
return refs;
}
static HRESULT WINAPI MimeInternat_SetDefaultCharset(IMimeInternational *iface, HCHARSET hCharset)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_GetDefaultCharset(IMimeInternational *iface, LPHCHARSET phCharset)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_GetCodePageCharset(IMimeInternational *iface, CODEPAGEID cpiCodePage,
CHARSETTYPE ctCsetType,
LPHCHARSET phCharset)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_FindCharset(IMimeInternational *iface, LPCSTR pszCharset,
LPHCHARSET phCharset)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_GetCharsetInfo(IMimeInternational *iface, HCHARSET hCharset,
LPINETCSETINFO pCsetInfo)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_GetCodePageInfo(IMimeInternational *iface, CODEPAGEID cpiCodePage,
LPCODEPAGEINFO pCodePageInfo)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_DecodeHeader(IMimeInternational *iface, HCHARSET hCharset,
LPCSTR pszData,
LPPROPVARIANT pDecoded,
LPRFC1522INFO pRfc1522Info)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_EncodeHeader(IMimeInternational *iface, HCHARSET hCharset,
LPPROPVARIANT pData,
LPSTR *ppszEncoded,
LPRFC1522INFO pRfc1522Info)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_ConvertBuffer(IMimeInternational *iface, CODEPAGEID cpiSource,
CODEPAGEID cpiDest,
LPBLOB pIn,
LPBLOB pOut,
ULONG *pcbRead)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_ConvertString(IMimeInternational *iface, CODEPAGEID cpiSource,
CODEPAGEID cpiDest,
LPPROPVARIANT pIn,
LPPROPVARIANT pOut)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_MLANG_ConvertInetReset(IMimeInternational *iface)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_MLANG_ConvertInetString(IMimeInternational *iface, CODEPAGEID cpiSource,
CODEPAGEID cpiDest,
LPCSTR pSource,
int *pnSizeOfSource,
LPSTR pDestination,
int *pnDstSize)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_Rfc1522Decode(IMimeInternational *iface, LPCSTR pszValue,
LPCSTR pszCharset,
ULONG cchmax,
LPSTR *ppszDecoded)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static HRESULT WINAPI MimeInternat_Rfc1522Encode(IMimeInternational *iface, LPCSTR pszValue,
HCHARSET hCharset,
LPSTR *ppszEncoded)
{
FIXME("stub\n");
return E_NOTIMPL;
}
static IMimeInternationalVtbl mime_internat_vtbl =
{
MimeInternat_QueryInterface,
MimeInternat_AddRef,
MimeInternat_Release,
MimeInternat_SetDefaultCharset,
MimeInternat_GetDefaultCharset,
MimeInternat_GetCodePageCharset,
MimeInternat_FindCharset,
MimeInternat_GetCharsetInfo,
MimeInternat_GetCodePageInfo,
MimeInternat_DecodeHeader,
MimeInternat_EncodeHeader,
MimeInternat_ConvertBuffer,
MimeInternat_ConvertString,
MimeInternat_MLANG_ConvertInetReset,
MimeInternat_MLANG_ConvertInetString,
MimeInternat_Rfc1522Decode,
MimeInternat_Rfc1522Encode
};
static internat *global_internat;
HRESULT MimeInternational_Construct(IMimeInternational **internat)
{
global_internat = HeapAlloc(GetProcessHeap(), 0, sizeof(*global_internat));
global_internat->lpVtbl = &mime_internat_vtbl;
global_internat->refs = 0;
*internat = (IMimeInternational*)&global_internat->lpVtbl;
IMimeInternational_AddRef(*internat);
return S_OK;
}
HRESULT WINAPI MimeOleGetInternat(IMimeInternational **internat)
{
TRACE("(%p)\n", internat);
*internat = (IMimeInternational *)&global_internat->lpVtbl;
IMimeInternational_AddRef(*internat);
return S_OK;
}

View File

@ -31,8 +31,8 @@
#include "ocidl.h"
#include "initguid.h"
#include "inetcomm_private.h"
#include "mimeole.h"
#include "inetcomm_private.h"
#include "wine/debug.h"