1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/ole/compobj.c
Alexandre Julliard e658d82093 Release 971130
Sat Nov 29 12:35:26 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [if1632/builtin.c]
	Build a complete PE header for builtin Win32 modules.

	* [loader/pe_image.c] [loader/module.c]
	HMODULE32 now points to the loading address of the module. There
	is no longer a separate PE_MODULE structure.

Fri Nov 28 11:21:47 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [ole/*][configure.in][Makefile.in][include/interfaces.h]
	  [if1632/olesvr32.spec][if1632/olecli32.spec]
	New directory, moved OLE stuff there.
	new .spec files for olecli32,olesvr32, some stubs added.

	* [misc/shell.c]
	Added support for extracting icons from PE dlls.

	* [misc/shellord.c][if1632/shell32.spec]
	Added a huge heap of ordinal only exported shell functions
	(will work only in Win95).

	* [loader/task.c]
	Hack to make MakeProcInstance16 work in all cases (mplayer.exe).

	* [win32/string32.c][include/string32.h]
	Obsolete, removed.

	* [windows/keyboard.c]
	Added *RegisterHotkey.

	* [objects/font.c][objects/text.c]
	Added GetFontLanguageInfo, GetTextCharsetInfo.

Wed Nov 26 18:10:40 1997  Uwe Bonnes  <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [misc/network.c]
	In WNetGetConnection16 return the Drive label and not the DOS-Cwd.
	Makes Wordview 6 start on a network connected machine.

	* [controls/status.c]
	Catch a Null pointer in SW_SetText.

	* [files/dos_fs.c]
 	Add NT5 functions GetLongPathName32.

	* [files/file.c]
	Make GetTempFileName16 accept drive 0 (Current Drive) too.
	Handle more errors and be more verbose in FILE_SetDosError, fix
	an error in DeleteFile32W

	* [memory/virtual.c]
	Implement FlushViewOfFile.

	* [misc/crtdll]
	Implement _rotl and splitpath and add a stub for 
	_abnormal_termination.

	* [misc/printdrv.c]
	Stub for EnumPrinters32A.

	* [win32/newfns]
	Add Stub for QueryPerformanceFrequency, change return value
	for QueryPerformanceCounter.
 	Add stub for DeviceIoControl.

Tue Nov 25 15:55:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>

	* [controls/combo.c] [controls/edit.c] [windows/defwnd.c]
	  [windows/winpos.c] [windows/win.c]
	Removed WIN_NO_REDRAW flag.

Tue Nov 25 13:20:35 1997  Douglas Ridgway <ridgway@taiga.v-wave.com>

	* [graphics/x11drv/bitblt.c]
	Fixed memory leak in BITBLT_GetDstArea.

Sun Nov 23 14:05:23 1997  Andreas Mohr <100.30936@germany.net>

	* [files/directory.c]
	Export windows system directory to environment.

	* [if1632/Makefile.in] [if1632/builtin.c] [if1632/w32skrnl.spec]
	  [if1632/win32s16.spec] [misc/w32scomb.c] [misc/w32skrnl.c]
	Added Win32s DLLs W32SKRNL and WIN32S16.

	* [if1632/kernel32.spec] [loader/module.c]
	Added misc functions for Win32s.

	* [if1632/kernel.spec] [loader/task.c]
	Added DefineHandleTable().

	* [scheduler/process.c]
	Fixed SetEnvironmentVariable32A() to avoid heap corruption.

Sat Nov 22 14:11:42 1997  Kristian Nielsen  <kristian.nielsen@risoe.dk>

	* [windows/painting.c]
	Fix leak in BeginPaint16() for CS_PARENTDC windows where the
	update region was not properly released.

Thu Nov 20 03:55:29 1997  Gordon Chaffee <chaffee@CS.Berkeley.EDU>

	* [loader/pe_image.c]
	Implemented forwarded DLL functions.

	* [objects/dib.c]
	Added support for 16- and 32-bit mode DIBs.
	Support negative bitmap heights.

	* [win32/process.c]
	Added stub for CreateProcess32W.

	* [win32/security.c] [include/ntdll.h]
	Added stubs for LookupAccountSid32A/W.

	* [scheduler/process.c]
	Use the size specified in the PE header for the process heap.

Mon Nov 17 00:53:35 1997  Len White <phreak@cgocable.net>

	* [msdos/int3d.c]
	New file. Stubs for int3d.

Sun Nov 16 12:30:00 PST 1997  Jason Schonberg  <schon@mti.sgi.com>

	* [include/aspi.h]
	Changed comment style from C++ to C.
1997-11-30 17:45:40 +00:00

187 lines
3.9 KiB
C

/*
* COMPOBJ library
*
* Copyright 1995 Martin von Loewis
*/
/* At the moment, these are only empty stubs.
*/
#define INITGUID
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "ole.h"
#include "ole2.h"
#include "stddebug.h"
#include "debug.h"
#include "compobj.h"
#include "interfaces.h"
#include "shlobj.h"
DWORD currentMalloc=0;
/***********************************************************************
* CoBuildVersion [COMPOBJ.1]
*/
DWORD WINAPI CoBuildVersion()
{
dprintf_ole(stddeb,"CoBuildVersion()\n");
return (rmm<<16)+rup;
}
/***********************************************************************
* CoInitialize [COMPOBJ.2]
* lpReserved is an IMalloc pointer in 16bit OLE. We just stored it as-is.
*/
HRESULT WINAPI CoInitialize(DWORD lpReserved)
{
dprintf_ole(stdnimp,"CoInitialize\n");
/* remember the LPMALLOC, maybe somebody wants to read it later on */
currentMalloc = lpReserved;
return S_OK;
}
/***********************************************************************
* CoUnitialize [COMPOBJ.3]
*/
void WINAPI CoUnitialize()
{
dprintf_ole(stdnimp,"CoUnitialize()\n");
}
/***********************************************************************
* CoGetMalloc [COMPOBJ.4]
*/
HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, DWORD * lpMalloc)
{
if(currentMalloc)
{
*lpMalloc = currentMalloc;
return S_OK;
}
*lpMalloc = 0;
/* 16-bit E_NOTIMPL */
return 0x80000001L;
}
/***********************************************************************
* CoDisconnectObject
*/
OLESTATUS WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
{
dprintf_ole(stdnimp,"CoDisconnectObject:%p %lx\n",lpUnk,reserved);
return OLE_OK;
}
/***********************************************************************
* IsEqualGUID [COMPOBJ.18]
*/
BOOL16 WINAPI IsEqualGUID(GUID* g1, GUID* g2)
{
return !memcmp( g1, g2, sizeof(GUID) );
}
/***********************************************************************
* CLSIDFromString [COMPOBJ.20]
*/
/* Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] */
OLESTATUS WINAPI CLSIDFromString(const LPCSTR idstr, CLSID *id)
{
BYTE *s = (BYTE *) idstr;
BYTE *p;
int i;
BYTE table[256];
dprintf_ole(stddeb,"ClsIDFromString() %s -> %p\n", idstr, id);
/* quick lookup table */
memset(table, 0, 256);
for (i = 0; i < 10; i++) {
table['0' + i] = i;
}
for (i = 0; i < 6; i++) {
table['A' + i] = i+10;
table['a' + i] = i+10;
}
/* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */
if (strlen(idstr) != 38)
return OLE_ERROR_OBJECT;
p = (BYTE *) id;
s++; /* skip leading brace */
for (i = 0; i < 4; i++) {
p[3 - i] = table[*s]<<4 | table[*(s+1)];
s += 2;
}
p += 4;
s++; /* skip - */
for (i = 0; i < 2; i++) {
p[1-i] = table[*s]<<4 | table[*(s+1)];
s += 2;
}
p += 2;
s++; /* skip - */
for (i = 0; i < 2; i++) {
p[1-i] = table[*s]<<4 | table[*(s+1)];
s += 2;
}
p += 2;
s++; /* skip - */
/* these are just sequential bytes */
for (i = 0; i < 2; i++) {
*p++ = table[*s]<<4 | table[*(s+1)];
s += 2;
}
s++; /* skip - */
for (i = 0; i < 6; i++) {
*p++ = table[*s]<<4 | table[*(s+1)];
s += 2;
}
return OLE_OK;
}
/***********************************************************************
* CLSIDFromString [COMPOBJ.19]
*/
OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR idstr)
{
static const char *hex = "0123456789ABCDEF";
char *s;
int i;
sprintf(idstr, "{%08lx-%04x-%04x-%02x%02x-",
id->Data1, id->Data2, id->Data3,
id->Data4[0], id->Data4[1]);
s = &idstr[25];
/* 6 hex bytes */
for (i = 2; i < 8; i++) {
*s++ = hex[id->Data4[i]>>4];
*s++ = hex[id->Data4[i] & 0xf];
}
*s++ = '}';
*s++ = '\0';
for (i = strlen(idstr)-1; i >= 0; i--) {
idstr[i] = toupper(idstr[i]);
}
dprintf_ole(stddeb,"StringFromClsID: %p->%s\n", id, idstr);
return OLE_OK;
}