Hi Piotr,
Piotr Caban wrote:
> Hi,
>
> Changelog:
> - Added skeleton for IDL files generation
>
> programs/oleview/main.h | 8 ++++
> programs/oleview/pane.c | 9 ++++
> programs/oleview/typelib.c | 96
> +++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 111 insertions(+), 2 deletions(-)
>
> --
> Piotr
>
>
> diff --git a/programs/oleview/typelib.c b/programs/oleview/typelib.c
> index 9eab7c4..8a46c1e 100644
> --- a/programs/oleview/typelib.c
> +++ b/programs/oleview/typelib.c
> @@ -30,6 +30,15 @@ static const WCHAR wszTypeLib[] = { 'T',
> static const WCHAR wszFailed[] = { '<','f','a','i','l','e','d','>','\0' };
> static const WCHAR wszSpace[] = { ' ','\0' };
> static const WCHAR wszAsterix[] = { '*','\0' };
> +static const WCHAR wszComa[] = { ',','\0' };
> +static const WCHAR wszSemicolon[] = { ';','\0' };
> +static const WCHAR wszNewLine[] = { '\n','\0' };
> +static const WCHAR wszOpenBrackets1[] = { '[','\0' };
> +static const WCHAR wszCloseBrackets1[] = { ']','\0' };
> +static const WCHAR wszOpenBrackets2[] = { '(','\0' };
> +static const WCHAR wszCloseBrackets2[] = { ')','\0' };
> +
> +static const WCHAR wszUUID[] = { 'u','u','i','d','\0' };
>
> static const WCHAR wszVT_BOOL[]
> = { 'V','A','R','I','A','N','T','_','B','O','O','L','\0' };
> @@ -61,6 +70,30 @@ void AddToStrW(WCHAR *wszDest, const WCH
> lstrcpyW(&wszDest[lstrlenW(wszDest)], wszSource);
> }
>
> +void AddToTLDataStrW(TYPELIB_DATA *pTLData, const WCHAR *wszSource)
> +{
> + WCHAR *newIdl;
> + int SourceLen = lstrlenW(wszSource);
> +
> + newIdl = HeapAlloc(GetProcessHeap(), 0,
> + sizeof(WCHAR)*(pTLData->idlLen+SourceLen+1));
> + memcpy(newIdl, pTLData->idl, sizeof(WCHAR)*pTLData->idlLen);
> + memcpy(&newIdl[pTLData->idlLen], wszSource, sizeof(WCHAR)*(SourceLen+1));
> + pTLData->idlLen += SourceLen;
> + HeapFree(GetProcessHeap(), 0, pTLData->idl);
>
It would be better to use HeapReAlloc here.
Jacek