Commit 6a0262b2 authored by Esme Povirk's avatar Esme Povirk Committed by Alexandre Julliard

diasymreader: Stub IPdbWriter.

parent b2fe43b5
......@@ -7,4 +7,6 @@ C_SRCS = \
main.c \
writer.c
IDL_SRCS = diasymreader.idl
RC_SRCS = diasymreader.rc
/*
* Copyright (C) 2022 Esme Povirk
*
* 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
*/
import "unknwn.idl";
import "objidl.idl";
import "oaidl.idl";
#pragma makedep header
/* Undocumented interface used by
* https://github.com/dotnet/symreader/blob/fe43beb65a8567834c717e2478ba36f1e98db8b5/src/Microsoft.DiaSymReader/Writer/ISymUnmanagedWriter.cs */
[
object,
uuid(98ecee1e-752d-11d3-8d56-00c04f680b2b),
pointer_default(unique)
]
interface IPdbWriter : IUnknown
{
HRESULT SetPath([in] const WCHAR *fullpath, [in] IStream *stream, [in] BOOL fullbuild);
HRESULT OpenMod([in] const WCHAR *modulename, [in] const WCHAR *filename);
HRESULT CloseMod();
HRESULT GetPath([in] DWORD ccData, [out] DWORD *pccData, [out, size_is(ccData), length_is(*pccData)] WCHAR *path);
HRESULT GetSignatureAge([out] DWORD *timestamp, [out] DWORD *age);
}
......@@ -19,5 +19,6 @@
#include "corhdr.h"
#include "cordebug.h"
#include "corsym.h"
#include "diasymreader.h"
HRESULT SymWriter_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
......@@ -35,6 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(diasymreader);
typedef struct SymWriter {
ISymUnmanagedWriter5 iface;
IPdbWriter IPdbWriter_iface;
LONG ref;
CRITICAL_SECTION lock;
GUID pdb_guid;
......@@ -47,6 +48,11 @@ static inline SymWriter *impl_from_ISymUnmanagedWriter5(ISymUnmanagedWriter5 *if
return CONTAINING_RECORD(iface, SymWriter, iface);
}
static inline SymWriter *impl_from_IPdbWriter(IPdbWriter *iface)
{
return CONTAINING_RECORD(iface, SymWriter, IPdbWriter_iface);
}
static HRESULT WINAPI SymWriter_QueryInterface(ISymUnmanagedWriter5 *iface, REFIID iid,
void **ppv)
{
......@@ -63,6 +69,10 @@ static HRESULT WINAPI SymWriter_QueryInterface(ISymUnmanagedWriter5 *iface, REFI
{
*ppv = &This->iface;
}
else if (IsEqualIID(&IID_IPdbWriter, iid))
{
*ppv = &This->IPdbWriter_iface;
}
else
{
WARN("unknown interface %s\n", debugstr_guid(iid));
......@@ -411,6 +421,65 @@ static const ISymUnmanagedWriter5Vtbl SymWriter_Vtbl = {
SymWriter_MapTokenToSourceSpan
};
static HRESULT WINAPI SymWriter_PdbWriter_QueryInterface(IPdbWriter *iface, REFIID iid, void **ppv)
{
SymWriter *This = impl_from_IPdbWriter(iface);
return ISymUnmanagedWriter5_QueryInterface(&This->iface, iid, ppv);
}
static ULONG WINAPI SymWriter_PdbWriter_AddRef(IPdbWriter *iface)
{
SymWriter *This = impl_from_IPdbWriter(iface);
return ISymUnmanagedWriter5_AddRef(&This->iface);
}
static ULONG WINAPI SymWriter_PdbWriter_Release(IPdbWriter *iface)
{
SymWriter *This = impl_from_IPdbWriter(iface);
return ISymUnmanagedWriter5_Release(&This->iface);
}
static HRESULT WINAPI SymWriter_SetPath(IPdbWriter *iface, const WCHAR *fullpath, IStream *stream, BOOL fullbuild)
{
FIXME("(%p,%s,%p,%u)\n", iface, debugstr_w(fullpath), stream, fullbuild);
return E_NOTIMPL;
}
static HRESULT WINAPI SymWriter_OpenMod(IPdbWriter *iface, const WCHAR *modulename, const WCHAR *fullpath)
{
FIXME("(%p,%s,%s)\n", iface, debugstr_w(modulename), debugstr_w(fullpath));
return E_NOTIMPL;
}
static HRESULT WINAPI SymWriter_CloseMod(IPdbWriter *iface)
{
FIXME("(%p)\n", iface);
return E_NOTIMPL;
}
static HRESULT WINAPI SymWriter_GetPath(IPdbWriter *iface, DWORD ccData, DWORD *pccData, WCHAR *path)
{
FIXME("(%p,%lu,%p,%p)\n", iface, ccData, pccData, path);
return E_NOTIMPL;
}
static HRESULT WINAPI SymWriter_GetSignatureAge(IPdbWriter *iface, DWORD *timestamp, DWORD *age)
{
FIXME("(%p,%p,%p)\n", iface, timestamp, age);
return E_NOTIMPL;
}
static const IPdbWriterVtbl SymWriter_PdbWriter_Vtbl = {
SymWriter_PdbWriter_QueryInterface,
SymWriter_PdbWriter_AddRef,
SymWriter_PdbWriter_Release,
SymWriter_SetPath,
SymWriter_OpenMod,
SymWriter_CloseMod,
SymWriter_GetPath,
SymWriter_GetSignatureAge
};
HRESULT SymWriter_CreateInstance(REFIID iid, void **ppv)
{
SymWriter *This;
......@@ -421,6 +490,7 @@ HRESULT SymWriter_CreateInstance(REFIID iid, void **ppv)
return E_OUTOFMEMORY;
This->iface.lpVtbl = &SymWriter_Vtbl;
This->IPdbWriter_iface.lpVtbl = &SymWriter_PdbWriter_Vtbl;
This->ref = 1;
InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SymWriter.lock");
......
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