Release 950403
Sun Apr 2 18:31:12 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [Configure] [if1632/Imakefile]
Removed new build and short names options.
* [if1632/*.c] [tools/build.c]
Implemented compiled call-back functions for better performance;
all the relay code is now done in assembly code generated by the
build program.
Relay code is no longer dependent on being loaded below 64K.
* [loader/resource.c]
Fixed memory leak in LoadString(). A fix will also be needed for
other resources.
* [memory/global.c]
Implemented global heap arenas, so we can store informations about
global blocks, like lock counts or owner handle.
Implemented FarGetOwner() and FarSetOwner().
Implemented global heap TOOLHELP functions.
* [memory/selector.c]
Bug fix: it was not possible to re-use a free selector.
Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis (csapuntz@mit.edu)
* [controls/listbox.c]
Major work on listbox code
- Many bugs fixed (still many bugs)
- More messages supported
- Code simplified
Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)
* [controls/edit.c]
Lots of bug fixes related to diappearing text, lost carets,
highlighting, segmentation faults, occurance of random
characters, insertion of characters over selection, misplaced
caret location, display corruption, end of line behavior, etc.
* [controls/widgets.c]
EDIT class doesn't want to use CS_PARENTDC flag.
Thu Mar 30 20:58:25 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [loader/selector.c]
FixupFunctionPrologs() should also handle multiple data modules.
(this bug only became visible because MakeProcInstance() was fixed
in 950319)
* [misc/dosfs.c]
Simplified DOS_SimplifyPath.
Small fix to DOS_opendir to reuse an entry if an open directory
is opened again, to prevent "too many open directories" messages.
Thu Mar 30 12:05:05 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
CoDisconnectObject: new stub function
* [include/msdos.h]
fix DOSVERSION
* [loader/ne_image.c]
NE_FixupSegment: Be more generous on additive fixups
* [if1632/user.spec][misc/network.c]
Add more WNet* stubs
Wed Mar 29 11:47:22 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c]
DlgDirList(): send segptr instead of linear pointer
in message to static control
* [controls/menu.c]
Tried to implement ownerdrawn menuitems. Doesn't work.
* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
Provide a stub for GetRasterizerCaps()
* [loader/selector.c]
Pass end address instead of length to LocalInit() in
CreateSelectors()
* [memory/local.c]
LocalInit(): If there's already a local heap in the segment, do
nothing and return TRUE
* [objects/linedda.c]
Replaced buggy LineDDA() with a Bresenham algorithm. Should work
now.
* [windows/cursor.c]
LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
more work still.
Tue Mar 21 17:54:43 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
[if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
[controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
[windows/nonclient.c] [misc/message.c]
Added a new builtin DLL that provides 16 bit entry points for all
the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
again.
* [misc/shell.c]
RegOpenKey()/RegCreateKey() bugs fixed.
* [loader/ne_image.c]
Skipping the initialization of a DLL when CS == 0 was broken.
1995-04-03 18:55:37 +02:00
|
|
|
/*
|
|
|
|
* COMPOBJ library
|
|
|
|
*
|
|
|
|
* Copyright 1995 Martin von Loewis
|
1998-11-08 14:36:39 +01:00
|
|
|
* Copyright 1998 Justin Bradford
|
1999-01-30 14:36:55 +01:00
|
|
|
* Copyright 1999 Francis Beaudet
|
2004-07-06 23:27:48 +02:00
|
|
|
* Copyright 1999 Sylvain St-Germain
|
|
|
|
* Copyright 2002 Marcus Meissner
|
|
|
|
* Copyright 2004 Mike Hearn
|
2006-08-16 14:00:02 +02:00
|
|
|
* Copyright 2005-2006 Robert Shearman (for CodeWeavers)
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-01-04 21:32:47 +01:00
|
|
|
*
|
2005-01-11 16:45:03 +01:00
|
|
|
* Note
|
|
|
|
* 1. COINIT_MULTITHREADED is 0; it is the lack of COINIT_APARTMENTTHREADED
|
|
|
|
* Therefore do not test against COINIT_MULTITHREADED
|
|
|
|
*
|
2005-01-04 21:32:47 +01:00
|
|
|
* TODO list: (items bunched together depend on each other)
|
|
|
|
*
|
|
|
|
* - Implement the service control manager (in rpcss) to keep track
|
|
|
|
* of registered class objects: ISCM::ServerRegisterClsid et al
|
2005-02-15 22:48:09 +01:00
|
|
|
* - Implement the OXID resolver so we don't need magic endpoint names for
|
2005-01-04 21:32:47 +01:00
|
|
|
* clients and servers to meet up
|
|
|
|
*
|
Release 950403
Sun Apr 2 18:31:12 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [Configure] [if1632/Imakefile]
Removed new build and short names options.
* [if1632/*.c] [tools/build.c]
Implemented compiled call-back functions for better performance;
all the relay code is now done in assembly code generated by the
build program.
Relay code is no longer dependent on being loaded below 64K.
* [loader/resource.c]
Fixed memory leak in LoadString(). A fix will also be needed for
other resources.
* [memory/global.c]
Implemented global heap arenas, so we can store informations about
global blocks, like lock counts or owner handle.
Implemented FarGetOwner() and FarSetOwner().
Implemented global heap TOOLHELP functions.
* [memory/selector.c]
Bug fix: it was not possible to re-use a free selector.
Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis (csapuntz@mit.edu)
* [controls/listbox.c]
Major work on listbox code
- Many bugs fixed (still many bugs)
- More messages supported
- Code simplified
Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)
* [controls/edit.c]
Lots of bug fixes related to diappearing text, lost carets,
highlighting, segmentation faults, occurance of random
characters, insertion of characters over selection, misplaced
caret location, display corruption, end of line behavior, etc.
* [controls/widgets.c]
EDIT class doesn't want to use CS_PARENTDC flag.
Thu Mar 30 20:58:25 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [loader/selector.c]
FixupFunctionPrologs() should also handle multiple data modules.
(this bug only became visible because MakeProcInstance() was fixed
in 950319)
* [misc/dosfs.c]
Simplified DOS_SimplifyPath.
Small fix to DOS_opendir to reuse an entry if an open directory
is opened again, to prevent "too many open directories" messages.
Thu Mar 30 12:05:05 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
CoDisconnectObject: new stub function
* [include/msdos.h]
fix DOSVERSION
* [loader/ne_image.c]
NE_FixupSegment: Be more generous on additive fixups
* [if1632/user.spec][misc/network.c]
Add more WNet* stubs
Wed Mar 29 11:47:22 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c]
DlgDirList(): send segptr instead of linear pointer
in message to static control
* [controls/menu.c]
Tried to implement ownerdrawn menuitems. Doesn't work.
* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
Provide a stub for GetRasterizerCaps()
* [loader/selector.c]
Pass end address instead of length to LocalInit() in
CreateSelectors()
* [memory/local.c]
LocalInit(): If there's already a local heap in the segment, do
nothing and return TRUE
* [objects/linedda.c]
Replaced buggy LineDDA() with a Bresenham algorithm. Should work
now.
* [windows/cursor.c]
LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
more work still.
Tue Mar 21 17:54:43 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
[if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
[controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
[windows/nonclient.c] [misc/message.c]
Added a new builtin DLL that provides 16 bit entry points for all
the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
again.
* [misc/shell.c]
RegOpenKey()/RegCreateKey() bugs fixed.
* [loader/ne_image.c]
Skipping the initialization of a DLL when CS == 0 was broken.
1995-04-03 18:55:37 +02:00
|
|
|
*/
|
|
|
|
|
1998-11-08 15:18:04 +01:00
|
|
|
#include "config.h"
|
1999-10-25 00:13:47 +02:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2000-02-10 23:15:21 +01:00
|
|
|
#include <stdio.h>
|
1997-08-04 18:34:36 +02:00
|
|
|
#include <string.h>
|
1999-01-30 14:36:55 +01:00
|
|
|
#include <assert.h>
|
2001-07-24 01:50:18 +02:00
|
|
|
|
2004-10-07 05:06:48 +02:00
|
|
|
#define COBJMACROS
|
2003-01-07 21:36:20 +01:00
|
|
|
#define NONAMELESSUNION
|
2004-10-07 05:06:48 +02:00
|
|
|
|
2012-11-26 15:20:13 +01:00
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2003-06-04 22:11:34 +02:00
|
|
|
#include "winbase.h"
|
2005-09-25 17:17:10 +02:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "winreg.h"
|
2003-06-04 22:11:34 +02:00
|
|
|
#include "winuser.h"
|
2009-06-23 15:25:56 +02:00
|
|
|
#define USE_COM_CONTEXT_DEF
|
2001-07-24 01:50:18 +02:00
|
|
|
#include "objbase.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
#include "ole2ver.h"
|
2009-01-14 18:28:09 +01:00
|
|
|
#include "ctxtcall.h"
|
2009-05-15 20:35:25 +02:00
|
|
|
#include "dde.h"
|
2013-05-23 13:20:41 +02:00
|
|
|
#include "servprov.h"
|
2005-09-25 17:17:10 +02:00
|
|
|
|
2010-12-03 19:51:08 +01:00
|
|
|
#include "initguid.h"
|
2000-11-25 04:08:23 +01:00
|
|
|
#include "compobj_private.h"
|
2010-12-03 19:51:08 +01:00
|
|
|
#include "moniker.h"
|
2001-07-24 01:50:18 +02:00
|
|
|
|
2005-09-25 17:17:10 +02:00
|
|
|
#include "wine/unicode.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
2000-02-10 23:15:21 +01:00
|
|
|
|
2005-06-20 12:33:17 +02:00
|
|
|
#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
|
|
|
|
|
1999-02-13 09:59:48 +01:00
|
|
|
/****************************************************************************
|
2002-08-03 02:17:10 +02:00
|
|
|
* This section defines variables internal to the COM module.
|
1999-02-13 09:59:48 +01:00
|
|
|
*/
|
|
|
|
|
2006-08-02 13:31:26 +02:00
|
|
|
static APARTMENT *MTA; /* protected by csApartment */
|
2006-08-26 13:02:31 +02:00
|
|
|
static APARTMENT *MainApartment; /* the first STA apartment */
|
2005-01-12 20:27:04 +01:00
|
|
|
static struct list apts = LIST_INIT( apts ); /* protected by csApartment */
|
2003-08-13 01:50:54 +02:00
|
|
|
|
|
|
|
static CRITICAL_SECTION csApartment;
|
|
|
|
static CRITICAL_SECTION_DEBUG critsect_debug =
|
|
|
|
{
|
|
|
|
0, 0, &csApartment,
|
|
|
|
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
2005-09-09 12:19:44 +02:00
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": csApartment") }
|
2003-08-13 01:50:54 +02:00
|
|
|
};
|
|
|
|
static CRITICAL_SECTION csApartment = { &critsect_debug, -1, 0, 0, 0, 0 };
|
Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c] [include/file.h]
Fixed SetFilePointer to allow negative positions as in DOS.
* [graphics/ddraw.c]
Added some methods to IDirect3D.
* [ole/compobj.c] [if1632/compobj.spec]
Added/implemented CoCreateStandardMalloc16,
CoGetClassObject, CoCreateInstance,
LookupETask, SetETask, CoGetState16.
* [loader/task.c]
MakeProcInstance: return 0 if func == NULL.
* [*/*] [tools/winapi-check]
Added zillions of missing WINAPI's and __cdecl's.
(oops, several caused by myself)
Wrote script for automated checking.
* [if1632/compobj.spec]
Many stub names.
* [misc/ddeml.c] [ole/compobj.c]
Some stubs.
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
Added preliminary tab control support.
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
More changes to the PostScript driver:
Implemented pens and solid brushes.
Colour/greyscale for fonts, pens and brushes.
To get coloured output you need to have *ColorDevice set to true
in your PPD, otherwise you'll get greyscale.
Landscape mode now works, as does non-A4 page sizes.
Encoding of fonts to ANSI is better, Symbol works again.
* [objects/dc.c] [include/gdi.h] [*/*]
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
belong.
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
[msdos/int2f.c] [msdos/interrupts.c]
Fixed portability. Adapted some code to make it easier to
integrate the DOS subsystem with the DPMI subsystem, made
the DPMI simulated real-mode interrupts be handled the V86
way. Added support for .COM files. Made int2f DPMI check
fail, to avoid pkunzip crashing in attempting to use DPMI.
Generally moved stuff around a little.
It is now technically possible to load several DOS programs
into the same memory space. Not tested, though.
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/kernel.spec]
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
* [win32/except.c]
Fixed one bad program behaviour, (deleting SEH while in
first walk). RtlUnwind is broken too I think (it should unwind
on success, not while walking the exception chain).
* [ole/ole2nls.c]
Get*DefaultLCID returns 0x400|id. expected by one application.
* [if1632/snoop.c]
Handle non-standard SP returns more graceful.
* [windows/class.c]
hinstances are mostly irrelevant for win32.
* [memory/string.c] [misc/registry.c]
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
for registry.c)
Some small speedup hacks for registry.c
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/comctl32/Makefile.in]
Created dlls/comctl32 and moved the common controls stuff to it.
* [misc/version.c]
Removed COMCTL32_DllGetVersion. The fixed function is part
of the common controls stuff.
* [dlls/comctl32/*.c][include/commctrl.h]
Added structure size tests.
* [dlls/comctl32/toolbar.c]
Fixed a bug in TOOLBAR_GetMaxWidth().
* [dlls/comctl32/animate.c][include/animate.h]
[dlls/comctl32/comboex.c][include/comboex.h]
[dlls/comctl32/hotkey.c][include/hotkey.h]
[dlls/comctl32/listview.c][include/listview.h]
[dlls/comctl32/commctrl.c][include/commctrl.h]
New files. Added Animation, ComboBoxEx, Hotkey and
Listview control dummies.
* [dlls/comctl32/tooltips.c]
Fixed a display bug and font selection.
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
Added missing DPA functions. Fixed bugs and published the
function prototypes.
* [documentation/common_controls]
Updated.
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
* [AUTHORS] [include/authors.h]
Added myself as a Wine author.
* [memory/virtual.c] [objects/dc.c]
Fixed runtime errors for Solaris.
* [misc/ddeml.c] [objects/gdiobj.c]
Minor fixes.
* [win32/device.c]
Added stubs for IFSMgr VxDCall and
a partial implementation of IFSMgr DeviceIo.
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
[relay32/msnet32.spec] [relay32/oledlg.spec]
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
Added news files for implementation of IMM32.DLL.
All functions return 0 as is correct for all Western Languages.
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
Added new files for implementation of OLEDLG.DLL.
Added stubs with FIXME:s for all functions.
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
[documentation/shell32][include/shell.h]
Clean up, bugfixes.
* [dlls/shell32/enumidlist.c]
Fileattributes implemented.
* [dlls/shell32/pidl.c]
Class pidlmgr splited into functions, structures changed,
some functions rewritten.
* [dlls/shell32/shell32_main.c]
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
* [dlls/shell32/shellord.c][relay32/shell32.spec]
Parameter documented, implemented SHCloneSpecialIDList.
Stub improved ShellExecuteEx32A.
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
SHGetDataFromIDListA, SHFileOperationA.
* [include/winnls.h][include/ole2nls.c]
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
in OLE_GetFormatA, GetTimeFormat32A.
* [win32/code_page.c]
WideCharToMultiByte: parameter checking and returning of strlen
implemented.
* [windows/keyboard.c][windows/defwnd.c]
Debug messages added.
* [windows/win.c]
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
* [controls/menu.c]
Missing line added.
* [include/winerror.h]
Macros for SUCCEEDED and FAILED added.
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [loader/module.c]
Bugfix: LoadModule16 should *not* call LoadModule32.
* [files/dos_fs.c]
Bugfix: don't crash if given directory doesn't exist.
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
Almost completed implementation of [snd]PlaySound (except
flags SND_ALIAS_ID and SND_APPLICATION).
* [if1632/user.spec][windows/winpos.c]
Added SetWindowRgn16 stub.
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
* [files/drive.c]
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
existent drive.
* [msdos/int21.c]
INT21_FindFirstFCB: check drive validity to prevent oops.
* [win32/file.c]
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [files/dos_fs.c]
Make DOSFS_OpenDir treat "" as "/".
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [windows/dialog.c]
GetNextDlgTabItem32: use last/first item instead of first/last
when hwndCtrl==0. This fixes initial focus.
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
* [include/process.h] [include/process.c]
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
with thread constant, and Win32 documentation (which calls it
a pseudohandle.) Made GetCurrentProcess actually use this
constant instead of the value.
* [include/process.h] [include/thread.h] [scheduler/thread.c]
[scheduler/process.c] [scheduler/handle.c]
Modify HANDLE_GetObjPtr to understand about
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
This allows DuplicateHandle to do the correct thing with these
handles. Removed now duplicate functionality from THREAD_GetPtr
and PROCESS_GetPtr.
* [loader/ne/segment.c]
Fixed two places where HFILE32s were being created and passed to
16-bit code. This should unbreak NE self-loading code.
Added two casts to remove compile time warnings.
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
* [msdos/dosmem.c] [msdos/int2f.c]
Added beginnings of DOS error table.
* [msdos/int1a.c]
Stub for subfunction 0xb0.
* [msdos/int10.c] [loader/dos/dosvm.c]
INT 10 support completely rewritten and lots of debugging
added. Now, DOS apps that use INT 10 to write to the screen will
work. (Beyond Zork does, at least. Somewhat.)
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
Another shot at getting MS's generic error message facility
right.
* [msdos/int21.c]
Command.Com wanted to set its own PSP address. I let it.
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
* [include/file.h] [misc/lzexpand.c]
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
convert lzw handles.
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/registry.c]
In RegEnumvalue, ivalue == 0 is a legal request and should
return the first entry.
* [msdos/int21.c]
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
* [windows/winproc.c]
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [windows/win.c]
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
flag when a child window is reparented to the desktop window.
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
* [controls/menu.c]
Menus created with SetMenuItemInfo and InsertMenuItem should
work now.
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
* [controls/combo.c]
Added CB_GETITEMHEIGHT.
* [windows/winpos.c]
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [include/windows.h]
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
GetPrivateProfileStructW, GetProfileSectionW,
WriteProfileSection[AW], WritePrivateProfileStructW.
1998-09-13 18:32:00 +02:00
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
enum comclass_threadingmodel
|
|
|
|
{
|
|
|
|
ThreadingModel_Apartment = 1,
|
|
|
|
ThreadingModel_Free = 2,
|
|
|
|
ThreadingModel_No = 3,
|
|
|
|
ThreadingModel_Both = 4,
|
|
|
|
ThreadingModel_Neutral = 5
|
|
|
|
};
|
|
|
|
|
2013-11-11 19:02:58 +01:00
|
|
|
enum comclass_miscfields
|
|
|
|
{
|
|
|
|
MiscStatus = 1,
|
|
|
|
MiscStatusIcon = 2,
|
|
|
|
MiscStatusContent = 4,
|
|
|
|
MiscStatusThumbnail = 8,
|
|
|
|
MiscStatusDocPrint = 16
|
|
|
|
};
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
struct comclassredirect_data
|
|
|
|
{
|
|
|
|
ULONG size;
|
|
|
|
BYTE res;
|
|
|
|
BYTE miscmask;
|
|
|
|
BYTE res1[2];
|
|
|
|
DWORD model;
|
|
|
|
GUID clsid;
|
|
|
|
GUID alias;
|
|
|
|
GUID clsid2;
|
|
|
|
GUID tlbid;
|
|
|
|
ULONG name_len;
|
|
|
|
ULONG name_offset;
|
|
|
|
ULONG progid_len;
|
|
|
|
ULONG progid_offset;
|
|
|
|
ULONG clrdata_len;
|
|
|
|
ULONG clrdata_offset;
|
|
|
|
DWORD miscstatus;
|
|
|
|
DWORD miscstatuscontent;
|
|
|
|
DWORD miscstatusthumbnail;
|
|
|
|
DWORD miscstatusicon;
|
|
|
|
DWORD miscstatusdocprint;
|
|
|
|
};
|
|
|
|
|
2013-09-27 20:59:03 +02:00
|
|
|
struct ifacepsredirect_data
|
|
|
|
{
|
|
|
|
ULONG size;
|
|
|
|
DWORD mask;
|
|
|
|
GUID iid;
|
|
|
|
ULONG nummethods;
|
|
|
|
GUID tlbid;
|
|
|
|
GUID base;
|
|
|
|
ULONG name_len;
|
|
|
|
ULONG name_offset;
|
|
|
|
};
|
|
|
|
|
2013-10-24 20:49:20 +02:00
|
|
|
struct progidredirect_data
|
|
|
|
{
|
|
|
|
ULONG size;
|
|
|
|
DWORD reserved;
|
|
|
|
ULONG clsid_offset;
|
|
|
|
};
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
struct class_reg_data
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct comclassredirect_data *data;
|
|
|
|
void *section;
|
|
|
|
HANDLE hactctx;
|
|
|
|
} actctx;
|
|
|
|
HKEY hkey;
|
|
|
|
} u;
|
|
|
|
BOOL hkey;
|
|
|
|
};
|
|
|
|
|
2006-07-20 20:30:21 +02:00
|
|
|
struct registered_psclsid
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
IID iid;
|
|
|
|
CLSID clsid;
|
|
|
|
};
|
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
static struct list registered_psclsid_list = LIST_INIT(registered_psclsid_list);
|
|
|
|
|
|
|
|
static CRITICAL_SECTION cs_registered_psclsid_list;
|
|
|
|
static CRITICAL_SECTION_DEBUG psclsid_cs_debug =
|
|
|
|
{
|
|
|
|
0, 0, &cs_registered_psclsid_list,
|
|
|
|
{ &psclsid_cs_debug.ProcessLocksList, &psclsid_cs_debug.ProcessLocksList },
|
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": cs_registered_psclsid_list") }
|
|
|
|
};
|
|
|
|
static CRITICAL_SECTION cs_registered_psclsid_list = { &psclsid_cs_debug, -1, 0, 0, 0, 0 };
|
|
|
|
|
2013-05-23 13:20:41 +02:00
|
|
|
/*
|
|
|
|
* This is a marshallable object exposing registered local servers.
|
|
|
|
* IServiceProvider is used only because it happens meet requirements
|
|
|
|
* and already has proxy/stub code. If more functionality is needed,
|
|
|
|
* a custom interface may be used instead.
|
|
|
|
*/
|
|
|
|
struct LocalServer
|
|
|
|
{
|
|
|
|
IServiceProvider IServiceProvider_iface;
|
|
|
|
LONG ref;
|
|
|
|
APARTMENT *apt;
|
|
|
|
IStream *marshal_stream;
|
|
|
|
};
|
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
/*
|
|
|
|
* This lock count counts the number of times CoInitialize is called. It is
|
|
|
|
* decreased every time CoUninitialize is called. When it hits 0, the COM
|
|
|
|
* libraries are freed
|
|
|
|
*/
|
2001-09-11 02:26:12 +02:00
|
|
|
static LONG s_COMLockCount = 0;
|
2007-03-09 19:55:13 +01:00
|
|
|
/* Reference count used by CoAddRefServerProcess/CoReleaseServerProcess */
|
|
|
|
static LONG s_COMServerProcessReferences = 0;
|
1999-01-30 14:36:55 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This linked list contains the list of registered class objects. These
|
|
|
|
* are mostly used to register the factories for out-of-proc servers of OLE
|
|
|
|
* objects.
|
|
|
|
*
|
|
|
|
* TODO: Make this data structure aware of inter-process communication. This
|
2008-09-16 13:42:38 +02:00
|
|
|
* means that parts of this will be exported to rpcss.
|
1999-01-30 14:36:55 +01:00
|
|
|
*/
|
|
|
|
typedef struct tagRegisteredClass
|
|
|
|
{
|
2007-03-09 19:54:07 +01:00
|
|
|
struct list entry;
|
1999-01-30 14:36:55 +01:00
|
|
|
CLSID classIdentifier;
|
2007-05-08 00:57:31 +02:00
|
|
|
OXID apartment_id;
|
1999-01-30 14:36:55 +01:00
|
|
|
LPUNKNOWN classObject;
|
|
|
|
DWORD runContext;
|
|
|
|
DWORD connectFlags;
|
|
|
|
DWORD dwCookie;
|
2007-03-09 18:42:34 +01:00
|
|
|
void *RpcRegistration;
|
1999-01-30 14:36:55 +01:00
|
|
|
} RegisteredClass;
|
|
|
|
|
2007-03-09 19:54:07 +01:00
|
|
|
static struct list RegisteredClassList = LIST_INIT(RegisteredClassList);
|
1998-11-07 13:19:26 +01:00
|
|
|
|
2003-08-13 01:50:54 +02:00
|
|
|
static CRITICAL_SECTION csRegisteredClassList;
|
|
|
|
static CRITICAL_SECTION_DEBUG class_cs_debug =
|
|
|
|
{
|
|
|
|
0, 0, &csRegisteredClassList,
|
|
|
|
{ &class_cs_debug.ProcessLocksList, &class_cs_debug.ProcessLocksList },
|
2005-09-09 12:19:44 +02:00
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": csRegisteredClassList") }
|
2003-08-13 01:50:54 +02:00
|
|
|
};
|
|
|
|
static CRITICAL_SECTION csRegisteredClassList = { &class_cs_debug, -1, 0, 0, 0, 0 };
|
|
|
|
|
2013-11-11 19:02:58 +01:00
|
|
|
static inline enum comclass_miscfields dvaspect_to_miscfields(DWORD aspect)
|
|
|
|
{
|
|
|
|
switch (aspect)
|
|
|
|
{
|
|
|
|
case DVASPECT_CONTENT:
|
|
|
|
return MiscStatusContent;
|
|
|
|
case DVASPECT_THUMBNAIL:
|
|
|
|
return MiscStatusThumbnail;
|
|
|
|
case DVASPECT_ICON:
|
|
|
|
return MiscStatusIcon;
|
|
|
|
case DVASPECT_DOCPRINT:
|
|
|
|
return MiscStatusDocPrint;
|
|
|
|
default:
|
|
|
|
return MiscStatus;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL actctx_get_miscstatus(const CLSID *clsid, DWORD aspect, DWORD *status)
|
|
|
|
{
|
|
|
|
ACTCTX_SECTION_KEYED_DATA data;
|
|
|
|
|
|
|
|
data.cbSize = sizeof(data);
|
|
|
|
if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
|
|
|
|
clsid, &data))
|
|
|
|
{
|
|
|
|
struct comclassredirect_data *comclass = (struct comclassredirect_data*)data.lpData;
|
|
|
|
enum comclass_miscfields misc = dvaspect_to_miscfields(aspect);
|
|
|
|
|
|
|
|
if (!(comclass->miscmask & misc))
|
|
|
|
{
|
|
|
|
if (!(comclass->miscmask & MiscStatus))
|
|
|
|
{
|
|
|
|
*status = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
misc = MiscStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (misc)
|
|
|
|
{
|
|
|
|
case MiscStatus:
|
|
|
|
*status = comclass->miscstatus;
|
|
|
|
break;
|
|
|
|
case MiscStatusIcon:
|
|
|
|
*status = comclass->miscstatusicon;
|
|
|
|
break;
|
|
|
|
case MiscStatusContent:
|
|
|
|
*status = comclass->miscstatuscontent;
|
|
|
|
break;
|
|
|
|
case MiscStatusThumbnail:
|
|
|
|
*status = comclass->miscstatusthumbnail;
|
|
|
|
break;
|
|
|
|
case MiscStatusDocPrint:
|
|
|
|
*status = comclass->miscstatusdocprint;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-11-26 15:20:13 +01:00
|
|
|
/* wrapper for NtCreateKey that creates the key recursively if necessary */
|
|
|
|
static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr )
|
|
|
|
{
|
|
|
|
NTSTATUS status = NtCreateKey( (HANDLE *)retkey, access, attr, 0, NULL, 0, NULL );
|
|
|
|
|
|
|
|
if (status == STATUS_OBJECT_NAME_NOT_FOUND)
|
|
|
|
{
|
|
|
|
HANDLE subkey, root = attr->RootDirectory;
|
|
|
|
WCHAR *buffer = attr->ObjectName->Buffer;
|
|
|
|
DWORD attrs, pos = 0, i = 0, len = attr->ObjectName->Length / sizeof(WCHAR);
|
|
|
|
UNICODE_STRING str;
|
|
|
|
|
|
|
|
while (i < len && buffer[i] != '\\') i++;
|
|
|
|
if (i == len) return status;
|
|
|
|
|
|
|
|
attrs = attr->Attributes;
|
|
|
|
attr->ObjectName = &str;
|
|
|
|
|
|
|
|
while (i < len)
|
|
|
|
{
|
|
|
|
str.Buffer = buffer + pos;
|
|
|
|
str.Length = (i - pos) * sizeof(WCHAR);
|
|
|
|
status = NtCreateKey( &subkey, access, attr, 0, NULL, 0, NULL );
|
|
|
|
if (attr->RootDirectory != root) NtClose( attr->RootDirectory );
|
|
|
|
if (status) return status;
|
|
|
|
attr->RootDirectory = subkey;
|
|
|
|
while (i < len && buffer[i] == '\\') i++;
|
|
|
|
pos = i;
|
|
|
|
while (i < len && buffer[i] != '\\') i++;
|
|
|
|
}
|
|
|
|
str.Buffer = buffer + pos;
|
|
|
|
str.Length = (i - pos) * sizeof(WCHAR);
|
|
|
|
attr->Attributes = attrs;
|
|
|
|
status = NtCreateKey( (PHANDLE)retkey, access, attr, 0, NULL, 0, NULL );
|
|
|
|
if (attr->RootDirectory != root) NtClose( attr->RootDirectory );
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const WCHAR classes_rootW[] =
|
2015-11-17 15:25:52 +01:00
|
|
|
{'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e',
|
|
|
|
'\\','S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s',0};
|
2012-11-26 15:20:13 +01:00
|
|
|
|
|
|
|
static HKEY classes_root_hkey;
|
|
|
|
|
|
|
|
/* create the special HKEY_CLASSES_ROOT key */
|
2014-07-15 12:34:39 +02:00
|
|
|
static HKEY create_classes_root_hkey(DWORD access)
|
2012-11-26 15:20:13 +01:00
|
|
|
{
|
|
|
|
HKEY hkey, ret = 0;
|
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING name;
|
|
|
|
|
|
|
|
attr.Length = sizeof(attr);
|
|
|
|
attr.RootDirectory = 0;
|
|
|
|
attr.ObjectName = &name;
|
|
|
|
attr.Attributes = 0;
|
|
|
|
attr.SecurityDescriptor = NULL;
|
|
|
|
attr.SecurityQualityOfService = NULL;
|
|
|
|
RtlInitUnicodeString( &name, classes_rootW );
|
2014-07-15 12:34:39 +02:00
|
|
|
if (create_key( &hkey, access, &attr )) return 0;
|
2012-11-26 15:20:13 +01:00
|
|
|
TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey );
|
|
|
|
|
2014-07-15 12:34:39 +02:00
|
|
|
if (!(access & KEY_WOW64_64KEY))
|
|
|
|
{
|
|
|
|
if (!(ret = InterlockedCompareExchangePointer( (void **)&classes_root_hkey, hkey, 0 )))
|
|
|
|
ret = hkey;
|
|
|
|
else
|
|
|
|
NtClose( hkey ); /* somebody beat us to it */
|
|
|
|
}
|
2012-11-26 15:20:13 +01:00
|
|
|
else
|
2014-07-15 12:34:39 +02:00
|
|
|
ret = hkey;
|
2012-11-26 15:20:13 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* map the hkey from special root to normal key if necessary */
|
2014-07-15 12:34:39 +02:00
|
|
|
static inline HKEY get_classes_root_hkey( HKEY hkey, REGSAM access )
|
2012-11-26 15:20:13 +01:00
|
|
|
{
|
|
|
|
HKEY ret = hkey;
|
2014-07-15 12:34:39 +02:00
|
|
|
const BOOL is_win64 = sizeof(void*) > sizeof(int);
|
|
|
|
const BOOL force_wow32 = is_win64 && (access & KEY_WOW64_32KEY);
|
2012-11-26 15:20:13 +01:00
|
|
|
|
2014-07-15 12:34:39 +02:00
|
|
|
if (hkey == HKEY_CLASSES_ROOT &&
|
|
|
|
((access & KEY_WOW64_64KEY) || !(ret = classes_root_hkey)))
|
|
|
|
ret = create_classes_root_hkey(MAXIMUM_ALLOWED | (access & KEY_WOW64_64KEY));
|
|
|
|
if (force_wow32 && ret && ret == classes_root_hkey)
|
|
|
|
{
|
|
|
|
static const WCHAR wow6432nodeW[] = {'W','o','w','6','4','3','2','N','o','d','e',0};
|
|
|
|
access &= ~KEY_WOW64_32KEY;
|
|
|
|
if (create_classes_key(classes_root_hkey, wow6432nodeW, access, &hkey))
|
|
|
|
return 0;
|
|
|
|
ret = hkey;
|
|
|
|
}
|
2012-11-26 15:20:13 +01:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
LSTATUS create_classes_key( HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey )
|
|
|
|
{
|
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING nameW;
|
|
|
|
|
2014-07-15 12:34:39 +02:00
|
|
|
if (!(hkey = get_classes_root_hkey( hkey, access ))) return ERROR_INVALID_HANDLE;
|
2012-11-26 15:20:13 +01:00
|
|
|
|
|
|
|
attr.Length = sizeof(attr);
|
|
|
|
attr.RootDirectory = hkey;
|
|
|
|
attr.ObjectName = &nameW;
|
|
|
|
attr.Attributes = 0;
|
|
|
|
attr.SecurityDescriptor = NULL;
|
|
|
|
attr.SecurityQualityOfService = NULL;
|
|
|
|
RtlInitUnicodeString( &nameW, name );
|
|
|
|
|
|
|
|
return RtlNtStatusToDosError( create_key( retkey, access, &attr ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
LSTATUS open_classes_key( HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey )
|
|
|
|
{
|
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING nameW;
|
|
|
|
|
2014-07-15 12:34:39 +02:00
|
|
|
if (!(hkey = get_classes_root_hkey( hkey, access ))) return ERROR_INVALID_HANDLE;
|
2012-11-26 15:20:13 +01:00
|
|
|
|
|
|
|
attr.Length = sizeof(attr);
|
|
|
|
attr.RootDirectory = hkey;
|
|
|
|
attr.ObjectName = &nameW;
|
|
|
|
attr.Attributes = 0;
|
|
|
|
attr.SecurityDescriptor = NULL;
|
|
|
|
attr.SecurityQualityOfService = NULL;
|
|
|
|
RtlInitUnicodeString( &nameW, name );
|
|
|
|
|
|
|
|
return RtlNtStatusToDosError( NtOpenKey( (HANDLE *)retkey, access, &attr ) );
|
|
|
|
}
|
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* This section contains OpenDllList definitions
|
|
|
|
*
|
|
|
|
* The OpenDllList contains only handles of dll loaded by CoGetClassObject or
|
2004-07-08 22:16:23 +02:00
|
|
|
* other functions that do LoadLibrary _without_ giving back a HMODULE.
|
|
|
|
* Without this list these handles would never be freed.
|
2002-08-03 02:17:10 +02:00
|
|
|
*
|
2004-07-08 22:16:23 +02:00
|
|
|
* FIXME: a DLL that says OK when asked for unloading is unloaded in the
|
2002-08-03 02:17:10 +02:00
|
|
|
* next unload-call but not before 600 sec.
|
1998-11-07 13:19:26 +01:00
|
|
|
*/
|
2002-08-03 02:17:10 +02:00
|
|
|
|
2007-04-04 19:56:51 +02:00
|
|
|
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
|
|
|
|
typedef HRESULT (WINAPI *DllCanUnloadNowFunc)(void);
|
|
|
|
|
2007-04-04 19:53:36 +02:00
|
|
|
typedef struct tagOpenDll
|
|
|
|
{
|
|
|
|
LONG refs;
|
|
|
|
LPWSTR library_name;
|
|
|
|
HANDLE library;
|
2007-04-04 19:56:51 +02:00
|
|
|
DllGetClassObjectFunc DllGetClassObject;
|
|
|
|
DllCanUnloadNowFunc DllCanUnloadNow;
|
2007-04-04 19:53:36 +02:00
|
|
|
struct list entry;
|
1998-11-07 13:19:26 +01:00
|
|
|
} OpenDll;
|
|
|
|
|
2007-04-04 19:53:36 +02:00
|
|
|
static struct list openDllList = LIST_INIT(openDllList);
|
1998-11-07 13:19:26 +01:00
|
|
|
|
2003-08-13 01:50:54 +02:00
|
|
|
static CRITICAL_SECTION csOpenDllList;
|
|
|
|
static CRITICAL_SECTION_DEBUG dll_cs_debug =
|
|
|
|
{
|
|
|
|
0, 0, &csOpenDllList,
|
|
|
|
{ &dll_cs_debug.ProcessLocksList, &dll_cs_debug.ProcessLocksList },
|
2005-09-09 12:19:44 +02:00
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": csOpenDllList") }
|
2003-08-13 01:50:54 +02:00
|
|
|
};
|
|
|
|
static CRITICAL_SECTION csOpenDllList = { &dll_cs_debug, -1, 0, 0, 0, 0 };
|
|
|
|
|
2007-04-04 19:57:31 +02:00
|
|
|
struct apartment_loaded_dll
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
OpenDll *dll;
|
2007-09-12 11:02:08 +02:00
|
|
|
DWORD unload_time;
|
2007-09-12 11:03:35 +02:00
|
|
|
BOOL multi_threaded;
|
2007-04-04 19:57:31 +02:00
|
|
|
};
|
|
|
|
|
2015-12-21 11:27:37 +01:00
|
|
|
static const WCHAR wszAptWinClass[] = {'O','l','e','M','a','i','n','T','h','r','e','a','d','W','n','d','C','l','a','s','s',0};
|
2003-06-04 22:11:34 +02:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* This section contains OpenDllList implementation
|
|
|
|
*/
|
1999-01-30 14:36:55 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
static OpenDll *COMPOBJ_DllList_Get(LPCWSTR library_name)
|
|
|
|
{
|
|
|
|
OpenDll *ptr;
|
|
|
|
OpenDll *ret = NULL;
|
|
|
|
EnterCriticalSection(&csOpenDllList);
|
|
|
|
LIST_FOR_EACH_ENTRY(ptr, &openDllList, OpenDll, entry)
|
|
|
|
{
|
|
|
|
if (!strcmpiW(library_name, ptr->library_name) &&
|
|
|
|
(InterlockedIncrement(&ptr->refs) != 1) /* entry is being destroy if == 1 */)
|
|
|
|
{
|
|
|
|
ret = ptr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&csOpenDllList);
|
|
|
|
return ret;
|
|
|
|
}
|
2007-04-04 19:55:23 +02:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* caller must ensure that library_name is not already in the open dll list */
|
|
|
|
static HRESULT COMPOBJ_DllList_Add(LPCWSTR library_name, OpenDll **ret)
|
2001-09-11 02:26:12 +02:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
OpenDll *entry;
|
|
|
|
int len;
|
|
|
|
HRESULT hr = S_OK;
|
|
|
|
HANDLE hLibrary;
|
|
|
|
DllCanUnloadNowFunc DllCanUnloadNow;
|
|
|
|
DllGetClassObjectFunc DllGetClassObject;
|
2003-06-04 22:11:34 +02:00
|
|
|
|
2013-12-04 08:14:41 +01:00
|
|
|
TRACE("%s\n", debugstr_w(library_name));
|
2009-07-06 08:08:27 +02:00
|
|
|
|
|
|
|
*ret = COMPOBJ_DllList_Get(library_name);
|
|
|
|
if (*ret) return S_OK;
|
|
|
|
|
|
|
|
/* do this outside the csOpenDllList to avoid creating a lock dependency on
|
|
|
|
* the loader lock */
|
|
|
|
hLibrary = LoadLibraryExW(library_name, 0, LOAD_WITH_ALTERED_SEARCH_PATH);
|
|
|
|
if (!hLibrary)
|
|
|
|
{
|
|
|
|
ERR("couldn't load in-process dll %s\n", debugstr_w(library_name));
|
|
|
|
/* failure: DLL could not be loaded */
|
|
|
|
return E_ACCESSDENIED; /* FIXME: or should this be CO_E_DLLNOTFOUND? */
|
|
|
|
}
|
|
|
|
|
|
|
|
DllCanUnloadNow = (void *)GetProcAddress(hLibrary, "DllCanUnloadNow");
|
|
|
|
/* Note: failing to find DllCanUnloadNow is not a failure */
|
|
|
|
DllGetClassObject = (void *)GetProcAddress(hLibrary, "DllGetClassObject");
|
|
|
|
if (!DllGetClassObject)
|
|
|
|
{
|
|
|
|
/* failure: the dll did not export DllGetClassObject */
|
|
|
|
ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(library_name));
|
|
|
|
FreeLibrary(hLibrary);
|
|
|
|
return CO_E_DLLNOTFOUND;
|
|
|
|
}
|
|
|
|
|
|
|
|
EnterCriticalSection( &csOpenDllList );
|
|
|
|
|
|
|
|
*ret = COMPOBJ_DllList_Get(library_name);
|
|
|
|
if (*ret)
|
|
|
|
{
|
|
|
|
/* another caller to this function already added the dll while we
|
|
|
|
* weren't in the critical section */
|
|
|
|
FreeLibrary(hLibrary);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
len = strlenW(library_name);
|
|
|
|
entry = HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
|
|
|
|
if (entry)
|
|
|
|
entry->library_name = HeapAlloc(GetProcessHeap(), 0, (len + 1)*sizeof(WCHAR));
|
|
|
|
if (entry && entry->library_name)
|
|
|
|
{
|
|
|
|
memcpy(entry->library_name, library_name, (len + 1)*sizeof(WCHAR));
|
|
|
|
entry->library = hLibrary;
|
|
|
|
entry->refs = 1;
|
|
|
|
entry->DllCanUnloadNow = DllCanUnloadNow;
|
|
|
|
entry->DllGetClassObject = DllGetClassObject;
|
|
|
|
list_add_tail(&openDllList, &entry->entry);
|
2013-03-31 16:54:02 +02:00
|
|
|
*ret = entry;
|
2009-07-06 08:08:27 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, entry);
|
|
|
|
hr = E_OUTOFMEMORY;
|
|
|
|
FreeLibrary(hLibrary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection( &csOpenDllList );
|
|
|
|
|
|
|
|
return hr;
|
2001-09-11 02:26:12 +02:00
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* pass FALSE for free_entry to release a reference without destroying the
|
|
|
|
* entry if it reaches zero or TRUE otherwise */
|
|
|
|
static void COMPOBJ_DllList_ReleaseRef(OpenDll *entry, BOOL free_entry)
|
2001-09-11 02:26:12 +02:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
if (!InterlockedDecrement(&entry->refs) && free_entry)
|
|
|
|
{
|
|
|
|
EnterCriticalSection(&csOpenDllList);
|
|
|
|
list_remove(&entry->entry);
|
|
|
|
LeaveCriticalSection(&csOpenDllList);
|
|
|
|
|
|
|
|
TRACE("freeing %p\n", entry->library);
|
|
|
|
FreeLibrary(entry->library);
|
|
|
|
|
|
|
|
HeapFree(GetProcessHeap(), 0, entry->library_name);
|
|
|
|
HeapFree(GetProcessHeap(), 0, entry);
|
|
|
|
}
|
2001-09-11 02:26:12 +02:00
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* frees memory associated with active dll list */
|
|
|
|
static void COMPOBJ_DllList_Free(void)
|
2005-02-01 15:18:10 +01:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
OpenDll *entry, *cursor2;
|
|
|
|
EnterCriticalSection(&csOpenDllList);
|
|
|
|
LIST_FOR_EACH_ENTRY_SAFE(entry, cursor2, &openDllList, OpenDll, entry)
|
2005-02-01 15:18:10 +01:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
list_remove(&entry->entry);
|
|
|
|
|
|
|
|
HeapFree(GetProcessHeap(), 0, entry->library_name);
|
|
|
|
HeapFree(GetProcessHeap(), 0, entry);
|
2005-02-01 15:18:10 +01:00
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
LeaveCriticalSection(&csOpenDllList);
|
2011-11-17 09:53:19 +01:00
|
|
|
DeleteCriticalSection(&csOpenDllList);
|
2005-02-01 15:18:10 +01:00
|
|
|
}
|
|
|
|
|
2003-06-04 22:11:34 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Manage apartments.
|
|
|
|
*/
|
2004-07-06 23:27:48 +02:00
|
|
|
|
2009-07-06 08:09:06 +02:00
|
|
|
static DWORD apartment_addref(struct apartment *apt)
|
2009-07-06 08:08:27 +02:00
|
|
|
{
|
|
|
|
DWORD refs = InterlockedIncrement(&apt->refs);
|
|
|
|
TRACE("%s: before = %d\n", wine_dbgstr_longlong(apt->oxid), refs - 1);
|
|
|
|
return refs;
|
|
|
|
}
|
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
/* allocates memory and fills in the necessary fields for a new apartment
|
2006-08-26 13:02:31 +02:00
|
|
|
* object. must be called inside apartment cs */
|
2005-02-08 14:42:15 +01:00
|
|
|
static APARTMENT *apartment_construct(DWORD model)
|
2003-06-04 22:11:34 +02:00
|
|
|
{
|
2005-02-08 14:42:15 +01:00
|
|
|
APARTMENT *apt;
|
2003-06-04 22:11:34 +02:00
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
TRACE("creating new apartment, model=%d\n", model);
|
2005-01-12 20:27:04 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
apt = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*apt));
|
|
|
|
apt->tid = GetCurrentThreadId();
|
2005-01-12 20:27:04 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
list_init(&apt->proxies);
|
|
|
|
list_init(&apt->stubmgrs);
|
2007-04-04 19:57:31 +02:00
|
|
|
list_init(&apt->loaded_dlls);
|
2005-02-08 14:42:15 +01:00
|
|
|
apt->ipidc = 0;
|
|
|
|
apt->refs = 1;
|
|
|
|
apt->remunk_exported = FALSE;
|
|
|
|
apt->oidc = 1;
|
|
|
|
InitializeCriticalSection(&apt->cs);
|
2005-03-17 11:26:20 +01:00
|
|
|
DEBUG_SET_CRITSEC_NAME(&apt->cs, "apartment");
|
2005-02-08 14:42:15 +01:00
|
|
|
|
2006-02-20 11:15:57 +01:00
|
|
|
apt->multi_threaded = !(model & COINIT_APARTMENTTHREADED);
|
2005-02-08 14:42:15 +01:00
|
|
|
|
2006-02-20 11:15:57 +01:00
|
|
|
if (apt->multi_threaded)
|
2005-02-08 14:42:15 +01:00
|
|
|
{
|
|
|
|
/* FIXME: should be randomly generated by in an RPC call to rpcss */
|
2006-02-20 11:15:57 +01:00
|
|
|
apt->oxid = ((OXID)GetCurrentProcessId() << 32) | 0xcafe;
|
2005-02-08 14:42:15 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* FIXME: should be randomly generated by in an RPC call to rpcss */
|
2006-02-20 11:15:57 +01:00
|
|
|
apt->oxid = ((OXID)GetCurrentProcessId() << 32) | GetCurrentThreadId();
|
2005-02-08 14:42:15 +01:00
|
|
|
}
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
TRACE("Created apartment on OXID %s\n", wine_dbgstr_longlong(apt->oxid));
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
list_add_head(&apts, &apt->entry);
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
return apt;
|
|
|
|
}
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
/* gets and existing apartment if one exists or otherwise creates an apartment
|
|
|
|
* structure which stores OLE apartment-local information and stores a pointer
|
|
|
|
* to it in the thread-local storage */
|
2005-03-11 11:19:10 +01:00
|
|
|
static APARTMENT *apartment_get_or_create(DWORD model)
|
2005-02-08 14:42:15 +01:00
|
|
|
{
|
|
|
|
APARTMENT *apt = COM_CurrentApt();
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
if (!apt)
|
|
|
|
{
|
2005-01-05 18:14:33 +01:00
|
|
|
if (model & COINIT_APARTMENTTHREADED)
|
|
|
|
{
|
2006-08-26 13:02:31 +02:00
|
|
|
EnterCriticalSection(&csApartment);
|
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
apt = apartment_construct(model);
|
2006-08-26 13:02:31 +02:00
|
|
|
if (!MainApartment)
|
|
|
|
{
|
|
|
|
MainApartment = apt;
|
|
|
|
apt->main = TRUE;
|
|
|
|
TRACE("Created main-threaded apartment with OXID %s\n", wine_dbgstr_longlong(apt->oxid));
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection(&csApartment);
|
2007-11-30 19:06:07 +01:00
|
|
|
|
|
|
|
if (apt->main)
|
|
|
|
apartment_createwindowifneeded(apt);
|
2005-01-05 18:14:33 +01:00
|
|
|
}
|
2005-01-12 20:27:04 +01:00
|
|
|
else
|
|
|
|
{
|
2005-02-08 14:42:15 +01:00
|
|
|
EnterCriticalSection(&csApartment);
|
|
|
|
|
|
|
|
/* The multi-threaded apartment (MTA) contains zero or more threads interacting
|
|
|
|
* with free threaded (ie thread safe) COM objects. There is only ever one MTA
|
|
|
|
* in a process */
|
|
|
|
if (MTA)
|
|
|
|
{
|
|
|
|
TRACE("entering the multithreaded apartment %s\n", wine_dbgstr_longlong(MTA->oxid));
|
2005-03-11 11:19:10 +01:00
|
|
|
apartment_addref(MTA);
|
2005-02-08 14:42:15 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
MTA = apartment_construct(model);
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
apt = MTA;
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2005-02-08 14:42:15 +01:00
|
|
|
LeaveCriticalSection(&csApartment);
|
|
|
|
}
|
2006-08-26 13:02:31 +02:00
|
|
|
COM_CurrentInfo()->apt = apt;
|
2004-02-10 02:36:20 +01:00
|
|
|
}
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2003-06-04 22:11:34 +02:00
|
|
|
return apt;
|
|
|
|
}
|
|
|
|
|
2007-06-28 22:32:45 +02:00
|
|
|
static inline BOOL apartment_is_model(const APARTMENT *apt, DWORD model)
|
2006-02-20 11:15:57 +01:00
|
|
|
{
|
|
|
|
return (apt->multi_threaded == !(model & COINIT_APARTMENTTHREADED));
|
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
static void COM_RevokeRegisteredClassObject(RegisteredClass *curClass)
|
2005-01-05 18:14:33 +01:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
list_remove(&curClass->entry);
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
if (curClass->runContext & CLSCTX_LOCAL_SERVER)
|
|
|
|
RPC_StopLocalServer(curClass->RpcRegistration);
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
IUnknown_Release(curClass->classObject);
|
|
|
|
HeapFree(GetProcessHeap(), 0, curClass);
|
|
|
|
}
|
2005-01-12 20:27:04 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
static void COM_RevokeAllClasses(const struct apartment *apt)
|
|
|
|
{
|
|
|
|
RegisteredClass *curClass, *cursor;
|
2005-01-14 16:11:55 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
EnterCriticalSection( &csRegisteredClassList );
|
2005-01-06 20:39:07 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
LIST_FOR_EACH_ENTRY_SAFE(curClass, cursor, &RegisteredClassList, RegisteredClass, entry)
|
|
|
|
{
|
|
|
|
if (curClass->apartment_id == apt->oxid)
|
|
|
|
COM_RevokeRegisteredClassObject(curClass);
|
|
|
|
}
|
2007-05-08 00:57:31 +02:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
LeaveCriticalSection( &csRegisteredClassList );
|
|
|
|
}
|
2005-03-17 11:26:20 +01:00
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
static void revoke_registered_psclsids(void)
|
|
|
|
{
|
|
|
|
struct registered_psclsid *psclsid, *psclsid2;
|
|
|
|
|
|
|
|
EnterCriticalSection( &cs_registered_psclsid_list );
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY_SAFE(psclsid, psclsid2, ®istered_psclsid_list, struct registered_psclsid, entry)
|
|
|
|
{
|
|
|
|
list_remove(&psclsid->entry);
|
|
|
|
HeapFree(GetProcessHeap(), 0, psclsid);
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection( &cs_registered_psclsid_list );
|
|
|
|
}
|
|
|
|
|
2011-05-30 12:45:31 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Implementation of the manual reset event object. (CLSID_ManualResetEvent)
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct ManualResetEvent {
|
2012-08-13 11:41:02 +02:00
|
|
|
ISynchronize ISynchronize_iface;
|
|
|
|
ISynchronizeHandle ISynchronizeHandle_iface;
|
2011-05-30 12:45:31 +02:00
|
|
|
LONG ref;
|
|
|
|
HANDLE event;
|
|
|
|
} MREImpl;
|
|
|
|
|
|
|
|
static inline MREImpl *impl_from_ISynchronize(ISynchronize *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, MREImpl, ISynchronize_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ISynchronize_fnQueryInterface(ISynchronize *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronize(iface);
|
2012-08-13 11:41:02 +02:00
|
|
|
|
2011-05-30 12:45:31 +02:00
|
|
|
TRACE("%p (%s, %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
|
2012-08-13 11:41:02 +02:00
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISynchronize)) {
|
|
|
|
*ppv = &This->ISynchronize_iface;
|
|
|
|
}else if(IsEqualGUID(riid, &IID_ISynchronizeHandle)) {
|
|
|
|
*ppv = &This->ISynchronizeHandle_iface;
|
|
|
|
}else {
|
2011-05-30 12:45:31 +02:00
|
|
|
ERR("Unknown interface %s requested.\n", debugstr_guid(riid));
|
2012-08-13 11:41:02 +02:00
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2011-05-30 12:45:31 +02:00
|
|
|
}
|
|
|
|
|
2012-08-13 11:41:02 +02:00
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2011-05-30 12:45:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ISynchronize_fnAddRef(ISynchronize *iface)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronize(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
TRACE("%p - ref %d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ISynchronize_fnRelease(ISynchronize *iface)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronize(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
TRACE("%p - ref %d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref)
|
|
|
|
{
|
|
|
|
CloseHandle(This->event);
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ISynchronize_fnWait(ISynchronize *iface, DWORD dwFlags, DWORD dwMilliseconds)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronize(iface);
|
|
|
|
UINT index;
|
|
|
|
TRACE("%p (%08x, %08x)\n", This, dwFlags, dwMilliseconds);
|
|
|
|
return CoWaitForMultipleHandles(dwFlags, dwMilliseconds, 1, &This->event, &index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ISynchronize_fnSignal(ISynchronize *iface)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronize(iface);
|
|
|
|
TRACE("%p\n", This);
|
|
|
|
SetEvent(This->event);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ISynchronize_fnReset(ISynchronize *iface)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronize(iface);
|
|
|
|
TRACE("%p\n", This);
|
|
|
|
ResetEvent(This->event);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ISynchronizeVtbl vt_ISynchronize = {
|
|
|
|
ISynchronize_fnQueryInterface,
|
|
|
|
ISynchronize_fnAddRef,
|
|
|
|
ISynchronize_fnRelease,
|
|
|
|
ISynchronize_fnWait,
|
|
|
|
ISynchronize_fnSignal,
|
|
|
|
ISynchronize_fnReset
|
|
|
|
};
|
|
|
|
|
2012-08-13 11:41:02 +02:00
|
|
|
static inline MREImpl *impl_from_ISynchronizeHandle(ISynchronizeHandle *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, MREImpl, ISynchronizeHandle_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SynchronizeHandle_QueryInterface(ISynchronizeHandle *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronizeHandle(iface);
|
|
|
|
return ISynchronize_QueryInterface(&This->ISynchronize_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI SynchronizeHandle_AddRef(ISynchronizeHandle *iface)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronizeHandle(iface);
|
|
|
|
return ISynchronize_AddRef(&This->ISynchronize_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI SynchronizeHandle_Release(ISynchronizeHandle *iface)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronizeHandle(iface);
|
|
|
|
return ISynchronize_Release(&This->ISynchronize_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SynchronizeHandle_GetHandle(ISynchronizeHandle *iface, HANDLE *ph)
|
|
|
|
{
|
|
|
|
MREImpl *This = impl_from_ISynchronizeHandle(iface);
|
|
|
|
|
|
|
|
*ph = This->event;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ISynchronizeHandleVtbl SynchronizeHandleVtbl = {
|
|
|
|
SynchronizeHandle_QueryInterface,
|
|
|
|
SynchronizeHandle_AddRef,
|
|
|
|
SynchronizeHandle_Release,
|
|
|
|
SynchronizeHandle_GetHandle
|
|
|
|
};
|
|
|
|
|
2011-05-30 12:45:31 +02:00
|
|
|
static HRESULT ManualResetEvent_Construct(IUnknown *punkouter, REFIID iid, void **ppv)
|
|
|
|
{
|
|
|
|
MREImpl *This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MREImpl));
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if(punkouter)
|
|
|
|
FIXME("Aggregation not implemented.\n");
|
|
|
|
|
|
|
|
This->ref = 1;
|
|
|
|
This->ISynchronize_iface.lpVtbl = &vt_ISynchronize;
|
2012-08-13 11:41:02 +02:00
|
|
|
This->ISynchronizeHandle_iface.lpVtbl = &SynchronizeHandleVtbl;
|
2011-05-30 12:45:31 +02:00
|
|
|
This->event = CreateEventW(NULL, TRUE, FALSE, NULL);
|
|
|
|
|
|
|
|
hr = ISynchronize_QueryInterface(&This->ISynchronize_iface, iid, ppv);
|
|
|
|
ISynchronize_Release(&This->ISynchronize_iface);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2013-05-23 13:20:41 +02:00
|
|
|
static inline LocalServer *impl_from_IServiceProvider(IServiceProvider *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, LocalServer, IServiceProvider_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LocalServer_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
LocalServer *This = impl_from_IServiceProvider(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IServiceProvider)) {
|
|
|
|
*ppv = &This->IServiceProvider_iface;
|
|
|
|
}else {
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI LocalServer_AddRef(IServiceProvider *iface)
|
|
|
|
{
|
|
|
|
LocalServer *This = impl_from_IServiceProvider(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI LocalServer_Release(IServiceProvider *iface)
|
|
|
|
{
|
|
|
|
LocalServer *This = impl_from_IServiceProvider(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
|
|
|
assert(!This->apt);
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LocalServer_QueryService(IServiceProvider *iface, REFGUID guid, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
LocalServer *This = impl_from_IServiceProvider(iface);
|
|
|
|
APARTMENT *apt = COM_CurrentApt();
|
|
|
|
RegisteredClass *iter;
|
|
|
|
HRESULT hres = E_FAIL;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guid), debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(!This->apt)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
EnterCriticalSection(&csRegisteredClassList);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY(iter, &RegisteredClassList, RegisteredClass, entry) {
|
|
|
|
if(iter->apartment_id == apt->oxid
|
|
|
|
&& (iter->runContext & CLSCTX_LOCAL_SERVER)
|
|
|
|
&& IsEqualGUID(&iter->classIdentifier, guid)) {
|
|
|
|
hres = IUnknown_QueryInterface(iter->classObject, riid, ppv);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection( &csRegisteredClassList );
|
|
|
|
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IServiceProviderVtbl LocalServerVtbl = {
|
|
|
|
LocalServer_QueryInterface,
|
|
|
|
LocalServer_AddRef,
|
|
|
|
LocalServer_Release,
|
|
|
|
LocalServer_QueryService
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT get_local_server_stream(APARTMENT *apt, IStream **ret)
|
|
|
|
{
|
|
|
|
HRESULT hres = S_OK;
|
|
|
|
|
|
|
|
EnterCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
if(!apt->local_server) {
|
|
|
|
LocalServer *obj;
|
|
|
|
|
|
|
|
obj = heap_alloc(sizeof(*obj));
|
|
|
|
if(obj) {
|
|
|
|
obj->IServiceProvider_iface.lpVtbl = &LocalServerVtbl;
|
|
|
|
obj->ref = 1;
|
|
|
|
obj->apt = apt;
|
|
|
|
|
|
|
|
hres = CreateStreamOnHGlobal(0, TRUE, &obj->marshal_stream);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
hres = CoMarshalInterface(obj->marshal_stream, &IID_IServiceProvider, (IUnknown*)&obj->IServiceProvider_iface,
|
|
|
|
MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLESTRONG);
|
|
|
|
if(FAILED(hres))
|
|
|
|
IStream_Release(obj->marshal_stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
apt->local_server = obj;
|
|
|
|
else
|
|
|
|
heap_free(obj);
|
|
|
|
}else {
|
|
|
|
hres = E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
hres = IStream_Clone(apt->local_server->marshal_stream, ret);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
if(FAILED(hres))
|
|
|
|
ERR("Failed: %08x\n", hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CoRevokeClassObject [OLE32.@]
|
|
|
|
*
|
|
|
|
* Removes a class object from the class registry.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* dwRegister [I] Cookie returned from CoRegisterClassObject().
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Must be called from the same apartment that called CoRegisterClassObject(),
|
|
|
|
* otherwise it will fail with RPC_E_WRONG_THREAD.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoRegisterClassObject
|
|
|
|
*/
|
2015-11-12 15:58:07 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject(
|
2009-07-06 08:08:27 +02:00
|
|
|
DWORD dwRegister)
|
|
|
|
{
|
|
|
|
HRESULT hr = E_INVALIDARG;
|
|
|
|
RegisteredClass *curClass;
|
|
|
|
APARTMENT *apt;
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
TRACE("(%08x)\n",dwRegister);
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
apt = COM_CurrentApt();
|
|
|
|
if (!apt)
|
|
|
|
{
|
|
|
|
ERR("COM was not initialized\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
EnterCriticalSection( &csRegisteredClassList );
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY(curClass, &RegisteredClassList, RegisteredClass, entry)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Check if we have a match on the cookie.
|
|
|
|
*/
|
|
|
|
if (curClass->dwCookie == dwRegister)
|
|
|
|
{
|
|
|
|
if (curClass->apartment_id == apt->oxid)
|
|
|
|
{
|
|
|
|
COM_RevokeRegisteredClassObject(curClass);
|
|
|
|
hr = S_OK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ERR("called from wrong apartment, should be called from %s\n",
|
|
|
|
wine_dbgstr_longlong(curClass->apartment_id));
|
|
|
|
hr = RPC_E_WRONG_THREAD;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection( &csRegisteredClassList );
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* frees unused libraries loaded by apartment_getclassobject by calling the
|
|
|
|
* DLL's DllCanUnloadNow entry point */
|
|
|
|
static void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay)
|
|
|
|
{
|
|
|
|
struct apartment_loaded_dll *entry, *next;
|
|
|
|
EnterCriticalSection(&apt->cs);
|
|
|
|
LIST_FOR_EACH_ENTRY_SAFE(entry, next, &apt->loaded_dlls, struct apartment_loaded_dll, entry)
|
|
|
|
{
|
|
|
|
if (entry->dll->DllCanUnloadNow && (entry->dll->DllCanUnloadNow() == S_OK))
|
|
|
|
{
|
|
|
|
DWORD real_delay = delay;
|
|
|
|
|
|
|
|
if (real_delay == INFINITE)
|
|
|
|
{
|
|
|
|
/* DLLs that return multi-threaded objects aren't unloaded
|
|
|
|
* straight away to cope for programs that have races between
|
|
|
|
* last object destruction and threads in the DLLs that haven't
|
|
|
|
* finished, despite DllCanUnloadNow returning S_OK */
|
|
|
|
if (entry->multi_threaded)
|
|
|
|
real_delay = 10 * 60 * 1000; /* 10 minutes */
|
|
|
|
else
|
|
|
|
real_delay = 0;
|
|
|
|
}
|
|
|
|
|
2013-01-24 15:15:25 +01:00
|
|
|
if (!real_delay || (entry->unload_time && ((int)(GetTickCount() - entry->unload_time) > 0)))
|
2009-07-06 08:08:27 +02:00
|
|
|
{
|
|
|
|
list_remove(&entry->entry);
|
|
|
|
COMPOBJ_DllList_ReleaseRef(entry->dll, TRUE);
|
|
|
|
HeapFree(GetProcessHeap(), 0, entry);
|
|
|
|
}
|
|
|
|
else
|
2013-01-24 15:15:25 +01:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
entry->unload_time = GetTickCount() + real_delay;
|
2013-01-24 15:15:25 +01:00
|
|
|
if (!entry->unload_time) entry->unload_time = 1;
|
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
}
|
|
|
|
else if (entry->unload_time)
|
|
|
|
entry->unload_time = 0;
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
}
|
|
|
|
|
|
|
|
DWORD apartment_release(struct apartment *apt)
|
|
|
|
{
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
EnterCriticalSection(&csApartment);
|
|
|
|
|
|
|
|
ret = InterlockedDecrement(&apt->refs);
|
|
|
|
TRACE("%s: after = %d\n", wine_dbgstr_longlong(apt->oxid), ret);
|
|
|
|
/* destruction stuff that needs to happen under csApartment CS */
|
|
|
|
if (ret == 0)
|
|
|
|
{
|
|
|
|
if (apt == MTA) MTA = NULL;
|
|
|
|
else if (apt == MainApartment) MainApartment = NULL;
|
|
|
|
list_remove(&apt->entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection(&csApartment);
|
|
|
|
|
|
|
|
if (ret == 0)
|
|
|
|
{
|
|
|
|
struct list *cursor, *cursor2;
|
|
|
|
|
|
|
|
TRACE("destroying apartment %p, oxid %s\n", apt, wine_dbgstr_longlong(apt->oxid));
|
|
|
|
|
2013-05-23 13:20:41 +02:00
|
|
|
if(apt->local_server) {
|
|
|
|
LocalServer *local_server = apt->local_server;
|
|
|
|
LARGE_INTEGER zero;
|
|
|
|
|
|
|
|
memset(&zero, 0, sizeof(zero));
|
|
|
|
IStream_Seek(local_server->marshal_stream, zero, STREAM_SEEK_SET, NULL);
|
|
|
|
CoReleaseMarshalData(local_server->marshal_stream);
|
|
|
|
IStream_Release(local_server->marshal_stream);
|
|
|
|
local_server->marshal_stream = NULL;
|
|
|
|
|
|
|
|
apt->local_server = NULL;
|
|
|
|
local_server->apt = NULL;
|
|
|
|
IServiceProvider_Release(&local_server->IServiceProvider_iface);
|
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* Release the references to the registered class objects */
|
|
|
|
COM_RevokeAllClasses(apt);
|
|
|
|
|
|
|
|
/* no locking is needed for this apartment, because no other thread
|
|
|
|
* can access it at this point */
|
|
|
|
|
|
|
|
apartment_disconnectproxies(apt);
|
|
|
|
|
|
|
|
if (apt->win) DestroyWindow(apt->win);
|
|
|
|
if (apt->host_apt_tid) PostThreadMessageW(apt->host_apt_tid, WM_QUIT, 0, 0);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &apt->stubmgrs)
|
|
|
|
{
|
|
|
|
struct stub_manager *stubmgr = LIST_ENTRY(cursor, struct stub_manager, entry);
|
|
|
|
/* release the implicit reference given by the fact that the
|
|
|
|
* stub has external references (it must do since it is in the
|
|
|
|
* stub manager list in the apartment and all non-apartment users
|
|
|
|
* must have a ref on the apartment and so it cannot be destroyed).
|
|
|
|
*/
|
|
|
|
stub_manager_int_release(stubmgr);
|
|
|
|
}
|
|
|
|
|
2005-01-14 16:11:55 +01:00
|
|
|
/* if this assert fires, then another thread took a reference to a
|
|
|
|
* stub manager without taking a reference to the containing
|
|
|
|
* apartment, which it must do. */
|
|
|
|
assert(list_empty(&apt->stubmgrs));
|
|
|
|
|
2012-08-13 11:40:33 +02:00
|
|
|
if (apt->filter) IMessageFilter_Release(apt->filter);
|
2005-01-05 18:14:33 +01:00
|
|
|
|
2007-05-13 23:17:23 +02:00
|
|
|
/* free as many unused libraries as possible... */
|
2007-09-12 11:02:08 +02:00
|
|
|
apartment_freeunusedlibraries(apt, 0);
|
2007-05-13 23:17:23 +02:00
|
|
|
|
|
|
|
/* ... and free the memory for the apartment loaded dll entry and
|
|
|
|
* release the dll list reference without freeing the library for the
|
|
|
|
* rest */
|
2007-04-04 19:57:31 +02:00
|
|
|
while ((cursor = list_head(&apt->loaded_dlls)))
|
|
|
|
{
|
|
|
|
struct apartment_loaded_dll *apartment_loaded_dll = LIST_ENTRY(cursor, struct apartment_loaded_dll, entry);
|
2007-05-13 23:17:23 +02:00
|
|
|
COMPOBJ_DllList_ReleaseRef(apartment_loaded_dll->dll, FALSE);
|
2007-04-04 19:57:31 +02:00
|
|
|
list_remove(cursor);
|
|
|
|
HeapFree(GetProcessHeap(), 0, apartment_loaded_dll);
|
|
|
|
}
|
|
|
|
|
2005-03-17 11:26:20 +01:00
|
|
|
DEBUG_CLEAR_CRITSEC_NAME(&apt->cs);
|
2005-01-05 18:14:33 +01:00
|
|
|
DeleteCriticalSection(&apt->cs);
|
2005-03-17 11:26:20 +01:00
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, apt);
|
2003-06-04 22:11:34 +02:00
|
|
|
}
|
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-03-11 11:19:10 +01:00
|
|
|
/* The given OXID must be local to this process:
|
2005-01-05 18:14:33 +01:00
|
|
|
*
|
|
|
|
* The ref parameter is here mostly to ensure people remember that
|
|
|
|
* they get one, you should normally take a ref for thread safety.
|
|
|
|
*/
|
2005-03-11 11:19:10 +01:00
|
|
|
APARTMENT *apartment_findfromoxid(OXID oxid, BOOL ref)
|
2003-06-04 22:11:34 +02:00
|
|
|
{
|
2005-01-05 18:14:33 +01:00
|
|
|
APARTMENT *result = NULL;
|
|
|
|
struct list *cursor;
|
2003-06-04 22:11:34 +02:00
|
|
|
|
|
|
|
EnterCriticalSection(&csApartment);
|
2005-01-05 18:14:33 +01:00
|
|
|
LIST_FOR_EACH( cursor, &apts )
|
|
|
|
{
|
|
|
|
struct apartment *apt = LIST_ENTRY( cursor, struct apartment, entry );
|
|
|
|
if (apt->oxid == oxid)
|
|
|
|
{
|
|
|
|
result = apt;
|
2005-03-11 11:19:10 +01:00
|
|
|
if (ref) apartment_addref(result);
|
2005-01-05 18:14:33 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-06-04 22:11:34 +02:00
|
|
|
LeaveCriticalSection(&csApartment);
|
2004-12-27 20:21:47 +01:00
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
return result;
|
2004-12-27 20:21:47 +01:00
|
|
|
}
|
|
|
|
|
2005-01-25 11:57:24 +01:00
|
|
|
/* gets the apartment which has a given creator thread ID. The caller must
|
|
|
|
* release the reference from the apartment as soon as the apartment pointer
|
|
|
|
* is no longer required. */
|
2005-03-11 11:19:10 +01:00
|
|
|
APARTMENT *apartment_findfromtid(DWORD tid)
|
2005-01-25 11:57:24 +01:00
|
|
|
{
|
|
|
|
APARTMENT *result = NULL;
|
|
|
|
struct list *cursor;
|
|
|
|
|
|
|
|
EnterCriticalSection(&csApartment);
|
|
|
|
LIST_FOR_EACH( cursor, &apts )
|
|
|
|
{
|
|
|
|
struct apartment *apt = LIST_ENTRY( cursor, struct apartment, entry );
|
|
|
|
if (apt->tid == tid)
|
|
|
|
{
|
|
|
|
result = apt;
|
2005-03-11 11:19:10 +01:00
|
|
|
apartment_addref(result);
|
2005-01-25 11:57:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&csApartment);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2007-05-19 18:21:00 +02:00
|
|
|
/* gets the main apartment if it exists. The caller must
|
2006-08-26 12:42:40 +02:00
|
|
|
* release the reference from the apartment as soon as the apartment pointer
|
|
|
|
* is no longer required. */
|
2007-05-19 18:21:00 +02:00
|
|
|
static APARTMENT *apartment_findmain(void)
|
2006-08-26 12:42:40 +02:00
|
|
|
{
|
2007-05-19 18:21:00 +02:00
|
|
|
APARTMENT *result;
|
2006-08-26 12:42:40 +02:00
|
|
|
|
|
|
|
EnterCriticalSection(&csApartment);
|
2006-08-26 13:02:31 +02:00
|
|
|
|
2007-05-19 18:21:00 +02:00
|
|
|
result = MainApartment;
|
|
|
|
if (result) apartment_addref(result);
|
2006-08-26 13:02:31 +02:00
|
|
|
|
2006-08-26 12:42:40 +02:00
|
|
|
LeaveCriticalSection(&csApartment);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2009-05-05 12:49:17 +02:00
|
|
|
/* gets the multi-threaded apartment if it exists. The caller must
|
|
|
|
* release the reference from the apartment as soon as the apartment pointer
|
|
|
|
* is no longer required. */
|
|
|
|
static APARTMENT *apartment_find_multi_threaded(void)
|
|
|
|
{
|
|
|
|
APARTMENT *result = NULL;
|
|
|
|
struct list *cursor;
|
|
|
|
|
|
|
|
EnterCriticalSection(&csApartment);
|
|
|
|
|
|
|
|
LIST_FOR_EACH( cursor, &apts )
|
|
|
|
{
|
|
|
|
struct apartment *apt = LIST_ENTRY( cursor, struct apartment, entry );
|
|
|
|
if (apt->multi_threaded)
|
|
|
|
{
|
|
|
|
result = apt;
|
|
|
|
apartment_addref(result);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection(&csApartment);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* gets the specified class object by loading the appropriate DLL, if
|
|
|
|
* necessary and calls the DllGetClassObject function for the DLL */
|
|
|
|
static HRESULT apartment_getclassobject(struct apartment *apt, LPCWSTR dllpath,
|
|
|
|
BOOL apartment_threaded,
|
|
|
|
REFCLSID rclsid, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
static const WCHAR wszOle32[] = {'o','l','e','3','2','.','d','l','l',0};
|
|
|
|
HRESULT hr = S_OK;
|
|
|
|
BOOL found = FALSE;
|
|
|
|
struct apartment_loaded_dll *apartment_loaded_dll;
|
|
|
|
|
|
|
|
if (!strcmpiW(dllpath, wszOle32))
|
|
|
|
{
|
|
|
|
/* we don't need to control the lifetime of this dll, so use the local
|
|
|
|
* implementation of DllGetClassObject directly */
|
|
|
|
TRACE("calling ole32!DllGetClassObject\n");
|
|
|
|
hr = DllGetClassObject(rclsid, riid, ppv);
|
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
ERR("DllGetClassObject returned error 0x%08x\n", hr);
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
EnterCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
LIST_FOR_EACH_ENTRY(apartment_loaded_dll, &apt->loaded_dlls, struct apartment_loaded_dll, entry)
|
|
|
|
if (!strcmpiW(dllpath, apartment_loaded_dll->dll->library_name))
|
|
|
|
{
|
|
|
|
TRACE("found %s already loaded\n", debugstr_w(dllpath));
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
{
|
|
|
|
apartment_loaded_dll = HeapAlloc(GetProcessHeap(), 0, sizeof(*apartment_loaded_dll));
|
|
|
|
if (!apartment_loaded_dll)
|
|
|
|
hr = E_OUTOFMEMORY;
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
apartment_loaded_dll->unload_time = 0;
|
|
|
|
apartment_loaded_dll->multi_threaded = FALSE;
|
|
|
|
hr = COMPOBJ_DllList_Add( dllpath, &apartment_loaded_dll->dll );
|
|
|
|
if (FAILED(hr))
|
|
|
|
HeapFree(GetProcessHeap(), 0, apartment_loaded_dll);
|
|
|
|
}
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
TRACE("added new loaded dll %s\n", debugstr_w(dllpath));
|
|
|
|
list_add_tail(&apt->loaded_dlls, &apartment_loaded_dll->entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
/* one component being multi-threaded overrides any number of
|
|
|
|
* apartment-threaded components */
|
|
|
|
if (!apartment_threaded)
|
|
|
|
apartment_loaded_dll->multi_threaded = TRUE;
|
|
|
|
|
|
|
|
TRACE("calling DllGetClassObject %p\n", apartment_loaded_dll->dll->DllGetClassObject);
|
|
|
|
/* OK: get the ClassObject */
|
|
|
|
hr = apartment_loaded_dll->dll->DllGetClassObject(rclsid, riid, ppv);
|
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
ERR("DllGetClassObject returned error 0x%08x\n", hr);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* COM_RegReadPath [internal]
|
|
|
|
*
|
|
|
|
* Reads a registry value and expands it when necessary
|
|
|
|
*/
|
2013-09-27 06:47:15 +02:00
|
|
|
static DWORD COM_RegReadPath(const struct class_reg_data *regdata, WCHAR *dst, DWORD dstlen)
|
2009-07-06 08:08:27 +02:00
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
if (regdata->hkey)
|
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
DWORD keytype;
|
|
|
|
WCHAR src[MAX_PATH];
|
|
|
|
DWORD dwLength = dstlen * sizeof(WCHAR);
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
if( (ret = RegQueryValueExW(regdata->u.hkey, NULL, NULL, &keytype, (BYTE*)src, &dwLength)) == ERROR_SUCCESS ) {
|
2009-07-06 08:08:27 +02:00
|
|
|
if (keytype == REG_EXPAND_SZ) {
|
|
|
|
if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA;
|
|
|
|
} else {
|
2009-11-29 21:38:28 +01:00
|
|
|
const WCHAR *quote_start;
|
|
|
|
quote_start = strchrW(src, '\"');
|
|
|
|
if (quote_start) {
|
|
|
|
const WCHAR *quote_end = strchrW(quote_start + 1, '\"');
|
|
|
|
if (quote_end) {
|
|
|
|
memmove(src, quote_start + 1,
|
|
|
|
(quote_end - quote_start - 1) * sizeof(WCHAR));
|
|
|
|
src[quote_end - quote_start - 1] = '\0';
|
|
|
|
}
|
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
lstrcpynW(dst, src, dstlen);
|
|
|
|
}
|
2012-11-02 12:56:50 +01:00
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
return ret;
|
2013-09-27 06:47:15 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ULONG_PTR cookie;
|
|
|
|
WCHAR *nameW;
|
|
|
|
|
|
|
|
*dst = 0;
|
|
|
|
nameW = (WCHAR*)((BYTE*)regdata->u.actctx.section + regdata->u.actctx.data->name_offset);
|
|
|
|
ActivateActCtx(regdata->u.actctx.hactctx, &cookie);
|
|
|
|
ret = SearchPathW(NULL, nameW, NULL, dstlen, dst, NULL);
|
|
|
|
DeactivateActCtx(0, cookie);
|
|
|
|
return !*dst;
|
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
}
|
|
|
|
|
2006-08-26 12:42:40 +02:00
|
|
|
struct host_object_params
|
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
struct class_reg_data regdata;
|
2006-08-26 12:42:40 +02:00
|
|
|
CLSID clsid; /* clsid of object to marshal */
|
|
|
|
IID iid; /* interface to marshal */
|
2007-05-17 18:06:16 +02:00
|
|
|
HANDLE event; /* event signalling when ready for multi-threaded case */
|
|
|
|
HRESULT hr; /* result for multi-threaded case */
|
2006-08-26 12:42:40 +02:00
|
|
|
IStream *stream; /* stream that the object will be marshaled into */
|
2007-09-12 11:03:35 +02:00
|
|
|
BOOL apartment_threaded; /* is the component purely apartment-threaded? */
|
2006-08-26 12:42:40 +02:00
|
|
|
};
|
|
|
|
|
2007-04-04 19:55:23 +02:00
|
|
|
static HRESULT apartment_hostobject(struct apartment *apt,
|
|
|
|
const struct host_object_params *params)
|
2006-08-26 12:42:40 +02:00
|
|
|
{
|
|
|
|
IUnknown *object;
|
|
|
|
HRESULT hr;
|
|
|
|
static const LARGE_INTEGER llZero;
|
2007-04-04 19:55:23 +02:00
|
|
|
WCHAR dllpath[MAX_PATH+1];
|
2006-08-26 12:42:40 +02:00
|
|
|
|
2007-05-17 18:06:16 +02:00
|
|
|
TRACE("clsid %s, iid %s\n", debugstr_guid(¶ms->clsid), debugstr_guid(¶ms->iid));
|
2006-08-26 12:42:40 +02:00
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
if (COM_RegReadPath(¶ms->regdata, dllpath, ARRAYSIZE(dllpath)) != ERROR_SUCCESS)
|
2007-04-04 19:55:23 +02:00
|
|
|
{
|
|
|
|
/* failure: CLSID is not found in registry */
|
|
|
|
WARN("class %s not registered inproc\n", debugstr_guid(¶ms->clsid));
|
|
|
|
return REGDB_E_CLASSNOTREG;
|
|
|
|
}
|
|
|
|
|
2007-09-12 11:03:35 +02:00
|
|
|
hr = apartment_getclassobject(apt, dllpath, params->apartment_threaded,
|
|
|
|
¶ms->clsid, ¶ms->iid, (void **)&object);
|
2006-08-26 12:42:40 +02:00
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
hr = CoMarshalInterface(params->stream, ¶ms->iid, object, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
|
|
|
|
if (FAILED(hr))
|
|
|
|
IUnknown_Release(object);
|
|
|
|
IStream_Seek(params->stream, llZero, STREAM_SEEK_SET, NULL);
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2005-03-11 11:19:10 +01:00
|
|
|
static LRESULT CALLBACK apartment_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
2003-06-04 22:11:34 +02:00
|
|
|
{
|
2005-02-14 12:50:51 +01:00
|
|
|
switch (msg)
|
|
|
|
{
|
|
|
|
case DM_EXECUTERPC:
|
2005-09-14 12:07:01 +02:00
|
|
|
RPC_ExecuteCall((struct dispatch_params *)lParam);
|
|
|
|
return 0;
|
2006-08-26 12:42:40 +02:00
|
|
|
case DM_HOSTOBJECT:
|
2007-04-04 19:55:23 +02:00
|
|
|
return apartment_hostobject(COM_CurrentApt(), (const struct host_object_params *)lParam);
|
2005-02-14 12:50:51 +01:00
|
|
|
default:
|
|
|
|
return DefWindowProcW(hWnd, msg, wParam, lParam);
|
|
|
|
}
|
2005-01-05 18:14:33 +01:00
|
|
|
}
|
2003-06-04 22:11:34 +02:00
|
|
|
|
2007-05-17 18:06:16 +02:00
|
|
|
struct host_thread_params
|
|
|
|
{
|
|
|
|
COINIT threading_model;
|
|
|
|
HANDLE ready_event;
|
|
|
|
HWND apartment_hwnd;
|
|
|
|
};
|
|
|
|
|
2008-09-16 13:42:38 +02:00
|
|
|
/* thread for hosting an object to allow an object to appear to be created in
|
|
|
|
* an apartment with an incompatible threading model */
|
2007-05-17 18:06:16 +02:00
|
|
|
static DWORD CALLBACK apartment_hostobject_thread(LPVOID p)
|
|
|
|
{
|
|
|
|
struct host_thread_params *params = p;
|
|
|
|
MSG msg;
|
|
|
|
HRESULT hr;
|
|
|
|
struct apartment *apt;
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
|
|
|
hr = CoInitializeEx(NULL, params->threading_model);
|
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
|
|
|
|
apt = COM_CurrentApt();
|
|
|
|
if (params->threading_model == COINIT_APARTMENTTHREADED)
|
|
|
|
{
|
|
|
|
apartment_createwindowifneeded(apt);
|
|
|
|
params->apartment_hwnd = apartment_getwindow(apt);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
params->apartment_hwnd = NULL;
|
|
|
|
|
|
|
|
/* force the message queue to be created before signaling parent thread */
|
|
|
|
PeekMessageW(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
|
|
|
|
|
|
|
|
SetEvent(params->ready_event);
|
|
|
|
params = NULL; /* can't touch params after here as it may be invalid */
|
|
|
|
|
|
|
|
while (GetMessageW(&msg, NULL, 0, 0))
|
|
|
|
{
|
|
|
|
if (!msg.hwnd && (msg.message == DM_HOSTOBJECT))
|
|
|
|
{
|
2008-02-13 13:34:52 +01:00
|
|
|
struct host_object_params *obj_params = (struct host_object_params *)msg.lParam;
|
|
|
|
obj_params->hr = apartment_hostobject(apt, obj_params);
|
|
|
|
SetEvent(obj_params->event);
|
2007-05-17 18:06:16 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TranslateMessage(&msg);
|
|
|
|
DispatchMessageW(&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("exiting\n");
|
|
|
|
|
|
|
|
CoUninitialize();
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-09-16 13:42:38 +02:00
|
|
|
/* finds or creates a host apartment, creates the object inside it and returns
|
|
|
|
* a proxy to it so that the object can be used in the apartment of the
|
|
|
|
* caller of this function */
|
|
|
|
static HRESULT apartment_hostobject_in_hostapt(
|
|
|
|
struct apartment *apt, BOOL multi_threaded, BOOL main_apartment,
|
2013-09-27 06:47:15 +02:00
|
|
|
const struct class_reg_data *regdata, REFCLSID rclsid, REFIID riid, void **ppv)
|
2007-05-17 18:06:16 +02:00
|
|
|
{
|
|
|
|
struct host_object_params params;
|
|
|
|
HWND apartment_hwnd = NULL;
|
|
|
|
DWORD apartment_tid = 0;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (!multi_threaded && main_apartment)
|
|
|
|
{
|
2007-05-19 18:21:00 +02:00
|
|
|
APARTMENT *host_apt = apartment_findmain();
|
2007-05-17 18:06:16 +02:00
|
|
|
if (host_apt)
|
|
|
|
{
|
|
|
|
apartment_hwnd = apartment_getwindow(host_apt);
|
|
|
|
apartment_release(host_apt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!apartment_hwnd)
|
|
|
|
{
|
|
|
|
EnterCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
if (!apt->host_apt_tid)
|
|
|
|
{
|
|
|
|
struct host_thread_params thread_params;
|
|
|
|
HANDLE handles[2];
|
|
|
|
DWORD wait_value;
|
|
|
|
|
|
|
|
thread_params.threading_model = multi_threaded ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED;
|
|
|
|
handles[0] = thread_params.ready_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
|
|
|
thread_params.apartment_hwnd = NULL;
|
|
|
|
handles[1] = CreateThread(NULL, 0, apartment_hostobject_thread, &thread_params, 0, &apt->host_apt_tid);
|
|
|
|
if (!handles[1])
|
|
|
|
{
|
|
|
|
CloseHandle(handles[0]);
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
wait_value = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
|
|
|
|
CloseHandle(handles[0]);
|
|
|
|
CloseHandle(handles[1]);
|
|
|
|
if (wait_value == WAIT_OBJECT_0)
|
|
|
|
apt->host_apt_hwnd = thread_params.apartment_hwnd;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (multi_threaded || !main_apartment)
|
|
|
|
{
|
|
|
|
apartment_hwnd = apt->host_apt_hwnd;
|
|
|
|
apartment_tid = apt->host_apt_tid;
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* another thread may have become the main apartment in the time it took
|
|
|
|
* us to create the thread for the host apartment */
|
|
|
|
if (!apartment_hwnd && !multi_threaded && main_apartment)
|
|
|
|
{
|
2007-05-19 18:21:00 +02:00
|
|
|
APARTMENT *host_apt = apartment_findmain();
|
2007-05-17 18:06:16 +02:00
|
|
|
if (host_apt)
|
|
|
|
{
|
|
|
|
apartment_hwnd = apartment_getwindow(host_apt);
|
|
|
|
apartment_release(host_apt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
params.regdata = *regdata;
|
2007-05-17 18:06:16 +02:00
|
|
|
params.clsid = *rclsid;
|
|
|
|
params.iid = *riid;
|
|
|
|
hr = CreateStreamOnHGlobal(NULL, TRUE, ¶ms.stream);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
2007-09-12 11:03:35 +02:00
|
|
|
params.apartment_threaded = !multi_threaded;
|
2007-05-17 18:06:16 +02:00
|
|
|
if (multi_threaded)
|
|
|
|
{
|
|
|
|
params.hr = S_OK;
|
|
|
|
params.event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
|
|
|
if (!PostThreadMessageW(apartment_tid, DM_HOSTOBJECT, 0, (LPARAM)¶ms))
|
|
|
|
hr = E_OUTOFMEMORY;
|
|
|
|
else
|
2009-07-06 08:08:27 +02:00
|
|
|
{
|
|
|
|
WaitForSingleObject(params.event, INFINITE);
|
|
|
|
hr = params.hr;
|
|
|
|
}
|
|
|
|
CloseHandle(params.event);
|
2007-04-04 19:54:27 +02:00
|
|
|
}
|
|
|
|
else
|
2007-04-04 19:53:36 +02:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
if (!apartment_hwnd)
|
2007-04-04 19:54:27 +02:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
ERR("host apartment didn't create window\n");
|
2007-04-04 19:53:36 +02:00
|
|
|
hr = E_OUTOFMEMORY;
|
2007-04-04 19:54:27 +02:00
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
else
|
|
|
|
hr = SendMessageW(apartment_hwnd, DM_HOSTOBJECT, 0, (LPARAM)¶ms);
|
2002-08-03 02:17:10 +02:00
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = CoUnmarshalInterface(params.stream, riid, ppv);
|
|
|
|
IStream_Release(params.stream);
|
2007-04-04 19:53:36 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2013-10-17 17:55:03 +02:00
|
|
|
static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context )
|
|
|
|
{
|
|
|
|
WNDCLASSW wclass;
|
|
|
|
|
|
|
|
/* Dispatching to the correct thread in an apartment is done through
|
|
|
|
* window messages rather than RPC transports. When an interface is
|
|
|
|
* marshalled into another apartment in the same process, a window of the
|
|
|
|
* following class is created. The *caller* of CoMarshalInterface (i.e., the
|
|
|
|
* application) is responsible for pumping the message loop in that thread.
|
|
|
|
* The WM_USER messages which point to the RPCs are then dispatched to
|
|
|
|
* apartment_wndproc by the user's code from the apartment in which the
|
|
|
|
* interface was unmarshalled.
|
|
|
|
*/
|
|
|
|
memset(&wclass, 0, sizeof(wclass));
|
|
|
|
wclass.lpfnWndProc = apartment_wndproc;
|
|
|
|
wclass.hInstance = hProxyDll;
|
|
|
|
wclass.lpszClassName = wszAptWinClass;
|
|
|
|
RegisterClassW(&wclass);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* create a window for the apartment or return the current one if one has
|
|
|
|
* already been created */
|
|
|
|
HRESULT apartment_createwindowifneeded(struct apartment *apt)
|
2007-04-04 19:53:36 +02:00
|
|
|
{
|
2013-10-17 17:55:03 +02:00
|
|
|
static INIT_ONCE class_init_once = INIT_ONCE_STATIC_INIT;
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
if (apt->multi_threaded)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
if (!apt->win)
|
2007-04-04 19:53:36 +02:00
|
|
|
{
|
2013-10-17 17:55:03 +02:00
|
|
|
HWND hwnd;
|
|
|
|
|
|
|
|
InitOnceExecuteOnce( &class_init_once, register_class, NULL, NULL );
|
|
|
|
|
|
|
|
hwnd = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0,
|
|
|
|
HWND_MESSAGE, 0, hProxyDll, NULL);
|
2009-07-06 08:08:27 +02:00
|
|
|
if (!hwnd)
|
2007-04-04 19:53:36 +02:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
ERR("CreateWindow failed with error %d\n", GetLastError());
|
|
|
|
return HRESULT_FROM_WIN32(GetLastError());
|
2007-04-04 19:53:36 +02:00
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
if (InterlockedCompareExchangePointer((PVOID *)&apt->win, hwnd, NULL))
|
|
|
|
/* someone beat us to it */
|
|
|
|
DestroyWindow(hwnd);
|
2007-04-04 19:53:36 +02:00
|
|
|
}
|
2009-07-06 08:08:27 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2007-04-04 19:53:36 +02:00
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
/* retrieves the window for the main- or apartment-threaded apartment */
|
|
|
|
HWND apartment_getwindow(const struct apartment *apt)
|
2007-04-04 19:53:36 +02:00
|
|
|
{
|
2009-07-06 08:08:27 +02:00
|
|
|
assert(!apt->multi_threaded);
|
|
|
|
return apt->win;
|
|
|
|
}
|
2007-04-04 19:53:36 +02:00
|
|
|
|
2009-07-06 08:08:27 +02:00
|
|
|
static void COM_TlsDestroy(void)
|
|
|
|
{
|
|
|
|
struct oletls *info = NtCurrentTeb()->ReservedForOle;
|
|
|
|
if (info)
|
|
|
|
{
|
|
|
|
if (info->apt) apartment_release(info->apt);
|
|
|
|
if (info->errorinfo) IErrorInfo_Release(info->errorinfo);
|
|
|
|
if (info->state) IUnknown_Release(info->state);
|
2012-08-13 11:40:33 +02:00
|
|
|
if (info->spy) IInitializeSpy_Release(info->spy);
|
2009-07-06 08:08:27 +02:00
|
|
|
if (info->context_token) IObjContext_Release(info->context_token);
|
|
|
|
HeapFree(GetProcessHeap(), 0, info);
|
|
|
|
NtCurrentTeb()->ReservedForOle = NULL;
|
2007-11-10 17:06:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoBuildVersion [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Gets the build version of the DLL.
|
|
|
|
*
|
|
|
|
* PARAMS
|
2002-08-03 02:17:10 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Current build version, hiword is majornumber, loword is minornumber
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
*/
|
2002-08-03 02:17:10 +02:00
|
|
|
DWORD WINAPI CoBuildVersion(void)
|
|
|
|
{
|
|
|
|
TRACE("Returning version %d, build %d.\n", rmm, rup);
|
|
|
|
return (rmm<<16)+rup;
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
}
|
|
|
|
|
2008-11-26 10:28:43 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* CoRegisterInitializeSpy [OLE32.@]
|
|
|
|
*
|
|
|
|
* Add a Spy that watches CoInitializeEx calls
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* spy [I] Pointer to IUnknown interface that will be QueryInterface'd.
|
|
|
|
* cookie [II] cookie receiver
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK if not already initialized, S_FALSE otherwise.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoInitializeEx
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cookie)
|
|
|
|
{
|
|
|
|
struct oletls *info = COM_CurrentInfo();
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p, %p)\n", spy, cookie);
|
|
|
|
|
|
|
|
if (!spy || !cookie || !info)
|
|
|
|
{
|
|
|
|
if (!info)
|
|
|
|
WARN("Could not allocate tls\n");
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (info->spy)
|
|
|
|
{
|
|
|
|
FIXME("Already registered?\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2012-08-13 11:40:33 +02:00
|
|
|
hr = IInitializeSpy_QueryInterface(spy, &IID_IInitializeSpy, (void **) &info->spy);
|
2008-11-26 10:28:43 +01:00
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
cookie->QuadPart = (DWORD_PTR)spy;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2008-11-27 11:45:57 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* CoRevokeInitializeSpy [OLE32.@]
|
|
|
|
*
|
|
|
|
* Remove a spy that previously watched CoInitializeEx calls
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* cookie [I] The cookie obtained from a previous CoRegisterInitializeSpy call
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK if a spy is removed
|
|
|
|
* Failure: E_INVALIDARG
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoInitializeEx
|
|
|
|
*/
|
2008-11-26 10:28:43 +01:00
|
|
|
HRESULT WINAPI CoRevokeInitializeSpy(ULARGE_INTEGER cookie)
|
|
|
|
{
|
|
|
|
struct oletls *info = COM_CurrentInfo();
|
|
|
|
TRACE("(%s)\n", wine_dbgstr_longlong(cookie.QuadPart));
|
|
|
|
|
|
|
|
if (!info || !info->spy || cookie.QuadPart != (DWORD_PTR)info->spy)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2012-08-13 11:40:33 +02:00
|
|
|
IInitializeSpy_Release(info->spy);
|
2008-11-27 11:45:57 +01:00
|
|
|
info->spy = NULL;
|
2008-11-26 10:28:43 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2017-11-10 13:56:05 +01:00
|
|
|
HRESULT enter_apartment( struct oletls *info, DWORD model )
|
|
|
|
{
|
|
|
|
HRESULT hr = S_OK;
|
|
|
|
|
|
|
|
if (!info->apt)
|
|
|
|
{
|
|
|
|
if (!apartment_get_or_create( model ))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
else if (!apartment_is_model( info->apt, model ))
|
|
|
|
{
|
|
|
|
WARN( "Attempt to change threading model of this apartment from %s to %s\n",
|
|
|
|
info->apt->multi_threaded ? "multi-threaded" : "apartment threaded",
|
|
|
|
model & COINIT_APARTMENTTHREADED ? "apartment threaded" : "multi-threaded" );
|
|
|
|
return RPC_E_CHANGED_MODE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
hr = S_FALSE;
|
|
|
|
|
|
|
|
info->inits++;
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void leave_apartment( struct oletls *info )
|
|
|
|
{
|
|
|
|
if (!--info->inits)
|
|
|
|
{
|
|
|
|
if (info->ole_inits)
|
|
|
|
WARN( "Uninitializing apartment while Ole is still initialized\n" );
|
|
|
|
apartment_release( info->apt );
|
|
|
|
info->apt = NULL;
|
|
|
|
}
|
|
|
|
}
|
2008-11-26 10:28:43 +01:00
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoInitialize [OLE32.@]
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* Initializes the COM libraries by calling CoInitializeEx with
|
|
|
|
* COINIT_APARTMENTTHREADED, ie it enters a STA thread.
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* lpReserved [I] Pointer to IMalloc interface (obsolete, should be NULL).
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK if not already initialized, S_FALSE otherwise.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* SEE ALSO
|
|
|
|
* CoInitializeEx
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Just delegate to the newer method.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
return CoInitializeEx(lpReserved, COINIT_APARTMENTTHREADED);
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
}
|
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoInitializeEx [OLE32.@]
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Initializes the COM libraries.
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* lpReserved [I] Pointer to IMalloc interface (obsolete, should be NULL).
|
|
|
|
* dwCoInit [I] One or more flags from the COINIT enumeration. See notes.
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
1999-01-30 14:36:55 +01:00
|
|
|
* S_OK if successful,
|
|
|
|
* S_FALSE if this function was called already.
|
2004-07-06 23:27:48 +02:00
|
|
|
* RPC_E_CHANGED_MODE if a previous call to CoInitializeEx specified another
|
|
|
|
* threading model.
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* NOTES
|
|
|
|
*
|
|
|
|
* The behavior used to set the IMalloc used for memory management is
|
|
|
|
* obsolete.
|
2006-10-15 17:05:01 +02:00
|
|
|
* The dwCoInit parameter must specify one of the following apartment
|
2005-01-14 18:05:36 +01:00
|
|
|
* threading models:
|
|
|
|
*| COINIT_APARTMENTTHREADED - A single-threaded apartment (STA).
|
|
|
|
*| COINIT_MULTITHREADED - A multi-threaded apartment (MTA).
|
|
|
|
* The parameter may also specify zero or more of the following flags:
|
|
|
|
*| COINIT_DISABLE_OLE1DDE - Don't use DDE for OLE1 support.
|
|
|
|
*| COINIT_SPEED_OVER_MEMORY - Trade memory for speed.
|
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* SEE ALSO
|
|
|
|
* CoUninitialize
|
1999-01-17 17:32:32 +01:00
|
|
|
*/
|
2015-11-02 15:02:33 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
2008-11-26 10:28:43 +01:00
|
|
|
struct oletls *info = COM_CurrentInfo();
|
2017-11-10 13:56:05 +01:00
|
|
|
HRESULT hr;
|
1999-01-30 14:36:55 +01:00
|
|
|
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("(%p, %x)\n", lpReserved, (int)dwCoInit);
|
1999-01-30 14:36:55 +01:00
|
|
|
|
|
|
|
if (lpReserved!=NULL)
|
|
|
|
{
|
1999-07-04 18:02:24 +02:00
|
|
|
ERR("(%p, %x) - Bad parameter passed-in %p, must be an old Windows Application\n", lpReserved, (int)dwCoInit, lpReserved);
|
1999-01-30 14:36:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check the lock count. If this is the first time going through the initialize
|
|
|
|
* process, we have to initialize the libraries.
|
2001-09-11 02:26:12 +02:00
|
|
|
*
|
|
|
|
* And crank-up that lock count.
|
1999-01-30 14:36:55 +01:00
|
|
|
*/
|
2001-09-11 02:26:12 +02:00
|
|
|
if (InterlockedExchangeAdd(&s_COMLockCount,1)==0)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Initialize the various COM libraries and data structures.
|
|
|
|
*/
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("() - Initializing the COM libraries\n");
|
1999-01-30 14:36:55 +01:00
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
/* we may need to defer this until after apartment initialisation */
|
1999-03-23 14:48:56 +01:00
|
|
|
RunningObjectTableImpl_Initialize();
|
1999-01-30 14:36:55 +01:00
|
|
|
}
|
2003-06-04 22:11:34 +02:00
|
|
|
|
2008-11-26 10:28:43 +01:00
|
|
|
if (info->spy)
|
|
|
|
IInitializeSpy_PreInitialize(info->spy, dwCoInit, info->inits);
|
|
|
|
|
2017-11-10 13:56:05 +01:00
|
|
|
hr = enter_apartment( info, dwCoInit );
|
2008-11-26 10:28:43 +01:00
|
|
|
|
|
|
|
if (info->spy)
|
|
|
|
IInitializeSpy_PostInitialize(info->spy, hr, dwCoInit, info->inits);
|
1999-01-30 14:36:55 +01:00
|
|
|
|
|
|
|
return hr;
|
1999-01-17 17:32:32 +01:00
|
|
|
}
|
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoUninitialize [OLE32.@]
|
1999-01-30 14:36:55 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* This method will decrement the refcount on the current apartment, freeing
|
|
|
|
* the resources associated with it if it is the last thread in the apartment.
|
|
|
|
* If the last apartment is freed, the function will additionally release
|
|
|
|
* any COM resources associated with the process.
|
1999-01-30 14:36:55 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoInitializeEx
|
1999-01-30 14:36:55 +01:00
|
|
|
*/
|
2015-01-15 19:07:50 +01:00
|
|
|
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
2005-01-06 20:39:07 +01:00
|
|
|
struct oletls * info = COM_CurrentInfo();
|
2001-09-11 02:26:12 +02:00
|
|
|
LONG lCOMRefCnt;
|
2003-06-04 22:11:34 +02:00
|
|
|
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("()\n");
|
2001-09-11 02:26:12 +02:00
|
|
|
|
2005-01-06 20:39:07 +01:00
|
|
|
/* will only happen on OOM */
|
|
|
|
if (!info) return;
|
|
|
|
|
2008-11-26 10:28:43 +01:00
|
|
|
if (info->spy)
|
|
|
|
IInitializeSpy_PreUninitialize(info->spy, info->inits);
|
|
|
|
|
2005-01-06 20:39:07 +01:00
|
|
|
/* sanity check */
|
|
|
|
if (!info->inits)
|
|
|
|
{
|
|
|
|
ERR("Mismatched CoUninitialize\n");
|
2008-11-26 10:28:43 +01:00
|
|
|
|
|
|
|
if (info->spy)
|
|
|
|
IInitializeSpy_PostUninitialize(info->spy, info->inits);
|
2005-01-06 20:39:07 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-11-10 13:56:05 +01:00
|
|
|
leave_apartment( info );
|
2003-06-04 22:11:34 +02:00
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
/*
|
|
|
|
* Decrease the reference count.
|
|
|
|
* If we are back to 0 locks on the COM library, make sure we free
|
|
|
|
* all the associated data structures.
|
|
|
|
*/
|
2001-09-11 02:26:12 +02:00
|
|
|
lCOMRefCnt = InterlockedExchangeAdd(&s_COMLockCount,-1);
|
|
|
|
if (lCOMRefCnt==1)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("() - Releasing the COM libraries\n");
|
1999-01-30 14:36:55 +01:00
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
revoke_registered_psclsids();
|
1999-03-23 14:48:56 +01:00
|
|
|
RunningObjectTableImpl_UnInitialize();
|
2001-09-11 02:26:12 +02:00
|
|
|
}
|
|
|
|
else if (lCOMRefCnt<1) {
|
|
|
|
ERR( "CoUninitialize() - not CoInitialized.\n" );
|
|
|
|
InterlockedExchangeAdd(&s_COMLockCount,1); /* restore the lock count. */
|
|
|
|
}
|
2008-11-26 10:28:43 +01:00
|
|
|
if (info->spy)
|
|
|
|
IInitializeSpy_PostUninitialize(info->spy, info->inits);
|
1999-01-30 14:36:55 +01:00
|
|
|
}
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoDisconnectObject [OLE32.@]
|
2004-07-06 23:27:48 +02:00
|
|
|
*
|
|
|
|
* Disconnects all connections to this object from remote processes. Dispatches
|
2004-07-08 22:16:23 +02:00
|
|
|
* pending RPCs while blocking new RPCs from occurring, and then calls
|
2004-07-06 23:27:48 +02:00
|
|
|
* IMarshal::DisconnectObject on the given object.
|
|
|
|
*
|
|
|
|
* Typically called when the object server is forced to shut down, for instance by
|
|
|
|
* the user.
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpUnk [I] The object whose stub should be disconnected.
|
|
|
|
* reserved [I] Reserved. Should be set to 0.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoMarshalInterface, CoReleaseMarshalData, CoLockObjectExternal
|
Release 950403
Sun Apr 2 18:31:12 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [Configure] [if1632/Imakefile]
Removed new build and short names options.
* [if1632/*.c] [tools/build.c]
Implemented compiled call-back functions for better performance;
all the relay code is now done in assembly code generated by the
build program.
Relay code is no longer dependent on being loaded below 64K.
* [loader/resource.c]
Fixed memory leak in LoadString(). A fix will also be needed for
other resources.
* [memory/global.c]
Implemented global heap arenas, so we can store informations about
global blocks, like lock counts or owner handle.
Implemented FarGetOwner() and FarSetOwner().
Implemented global heap TOOLHELP functions.
* [memory/selector.c]
Bug fix: it was not possible to re-use a free selector.
Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis (csapuntz@mit.edu)
* [controls/listbox.c]
Major work on listbox code
- Many bugs fixed (still many bugs)
- More messages supported
- Code simplified
Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)
* [controls/edit.c]
Lots of bug fixes related to diappearing text, lost carets,
highlighting, segmentation faults, occurance of random
characters, insertion of characters over selection, misplaced
caret location, display corruption, end of line behavior, etc.
* [controls/widgets.c]
EDIT class doesn't want to use CS_PARENTDC flag.
Thu Mar 30 20:58:25 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [loader/selector.c]
FixupFunctionPrologs() should also handle multiple data modules.
(this bug only became visible because MakeProcInstance() was fixed
in 950319)
* [misc/dosfs.c]
Simplified DOS_SimplifyPath.
Small fix to DOS_opendir to reuse an entry if an open directory
is opened again, to prevent "too many open directories" messages.
Thu Mar 30 12:05:05 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
CoDisconnectObject: new stub function
* [include/msdos.h]
fix DOSVERSION
* [loader/ne_image.c]
NE_FixupSegment: Be more generous on additive fixups
* [if1632/user.spec][misc/network.c]
Add more WNet* stubs
Wed Mar 29 11:47:22 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c]
DlgDirList(): send segptr instead of linear pointer
in message to static control
* [controls/menu.c]
Tried to implement ownerdrawn menuitems. Doesn't work.
* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
Provide a stub for GetRasterizerCaps()
* [loader/selector.c]
Pass end address instead of length to LocalInit() in
CreateSelectors()
* [memory/local.c]
LocalInit(): If there's already a local heap in the segment, do
nothing and return TRUE
* [objects/linedda.c]
Replaced buggy LineDDA() with a Bresenham algorithm. Should work
now.
* [windows/cursor.c]
LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
more work still.
Tue Mar 21 17:54:43 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
[if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
[controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
[windows/nonclient.c] [misc/message.c]
Added a new builtin DLL that provides 16 bit entry points for all
the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
again.
* [misc/shell.c]
RegOpenKey()/RegCreateKey() bugs fixed.
* [loader/ne_image.c]
Skipping the initialization of a DLL when CS == 0 was broken.
1995-04-03 18:55:37 +02:00
|
|
|
*/
|
1999-01-17 17:32:32 +01:00
|
|
|
HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
|
Release 950403
Sun Apr 2 18:31:12 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [Configure] [if1632/Imakefile]
Removed new build and short names options.
* [if1632/*.c] [tools/build.c]
Implemented compiled call-back functions for better performance;
all the relay code is now done in assembly code generated by the
build program.
Relay code is no longer dependent on being loaded below 64K.
* [loader/resource.c]
Fixed memory leak in LoadString(). A fix will also be needed for
other resources.
* [memory/global.c]
Implemented global heap arenas, so we can store informations about
global blocks, like lock counts or owner handle.
Implemented FarGetOwner() and FarSetOwner().
Implemented global heap TOOLHELP functions.
* [memory/selector.c]
Bug fix: it was not possible to re-use a free selector.
Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis (csapuntz@mit.edu)
* [controls/listbox.c]
Major work on listbox code
- Many bugs fixed (still many bugs)
- More messages supported
- Code simplified
Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)
* [controls/edit.c]
Lots of bug fixes related to diappearing text, lost carets,
highlighting, segmentation faults, occurance of random
characters, insertion of characters over selection, misplaced
caret location, display corruption, end of line behavior, etc.
* [controls/widgets.c]
EDIT class doesn't want to use CS_PARENTDC flag.
Thu Mar 30 20:58:25 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [loader/selector.c]
FixupFunctionPrologs() should also handle multiple data modules.
(this bug only became visible because MakeProcInstance() was fixed
in 950319)
* [misc/dosfs.c]
Simplified DOS_SimplifyPath.
Small fix to DOS_opendir to reuse an entry if an open directory
is opened again, to prevent "too many open directories" messages.
Thu Mar 30 12:05:05 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
CoDisconnectObject: new stub function
* [include/msdos.h]
fix DOSVERSION
* [loader/ne_image.c]
NE_FixupSegment: Be more generous on additive fixups
* [if1632/user.spec][misc/network.c]
Add more WNet* stubs
Wed Mar 29 11:47:22 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c]
DlgDirList(): send segptr instead of linear pointer
in message to static control
* [controls/menu.c]
Tried to implement ownerdrawn menuitems. Doesn't work.
* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
Provide a stub for GetRasterizerCaps()
* [loader/selector.c]
Pass end address instead of length to LocalInit() in
CreateSelectors()
* [memory/local.c]
LocalInit(): If there's already a local heap in the segment, do
nothing and return TRUE
* [objects/linedda.c]
Replaced buggy LineDDA() with a Bresenham algorithm. Should work
now.
* [windows/cursor.c]
LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
more work still.
Tue Mar 21 17:54:43 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
[if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
[controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
[windows/nonclient.c] [misc/message.c]
Added a new builtin DLL that provides 16 bit entry points for all
the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
again.
* [misc/shell.c]
RegOpenKey()/RegCreateKey() bugs fixed.
* [loader/ne_image.c]
Skipping the initialization of a DLL when CS == 0 was broken.
1995-04-03 18:55:37 +02:00
|
|
|
{
|
2015-09-04 11:50:19 +02:00
|
|
|
struct stub_manager *manager;
|
2005-02-08 17:51:22 +01:00
|
|
|
HRESULT hr;
|
|
|
|
IMarshal *marshal;
|
|
|
|
APARTMENT *apt;
|
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
TRACE("(%p, 0x%08x)\n", lpUnk, reserved);
|
2005-02-08 17:51:22 +01:00
|
|
|
|
2012-05-14 18:24:19 +02:00
|
|
|
if (!lpUnk) return E_INVALIDARG;
|
|
|
|
|
2005-02-08 17:51:22 +01:00
|
|
|
hr = IUnknown_QueryInterface(lpUnk, &IID_IMarshal, (void **)&marshal);
|
|
|
|
if (hr == S_OK)
|
|
|
|
{
|
|
|
|
hr = IMarshal_DisconnectObject(marshal, reserved);
|
|
|
|
IMarshal_Release(marshal);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
apt = COM_CurrentApt();
|
|
|
|
if (!apt)
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
|
2015-09-04 11:50:19 +02:00
|
|
|
manager = get_stub_manager_from_object(apt, lpUnk, FALSE);
|
|
|
|
if (manager) {
|
2015-10-13 15:49:15 +02:00
|
|
|
stub_manager_disconnect(manager);
|
2015-09-04 11:50:19 +02:00
|
|
|
/* Release stub manager twice, to remove the apartment reference. */
|
|
|
|
stub_manager_int_release(manager);
|
|
|
|
stub_manager_int_release(manager);
|
|
|
|
}
|
2005-02-08 17:51:22 +01:00
|
|
|
|
|
|
|
/* Note: native is pretty broken here because it just silently
|
|
|
|
* fails, without returning an appropriate error code if the object was
|
|
|
|
* not found, making apps think that the object was disconnected, when
|
|
|
|
* it actually wasn't */
|
|
|
|
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
return S_OK;
|
Release 970914
Thu Sep 11 18:24:56 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* [objects/dc.c]
In DC_SetupGCForPatBlt, replace R2_NOT by GXxor with (black xor white).
Tue Sep 9 23:04:02 1997 U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [memory/virtual.c]
Do not write debugging info unconditionally to stderr.
* [files/profile.c]
Call PROFILE_GetSection in PROFILE_GetString for key_name "" too.
* [misc/crtdll.c]
Many new functions.
* [include/windows.h] [windows/winpos.c]
ClientToScreen16 doesn't have a return value.
Sun Sep 7 10:06:39 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [misc/main.c] [AUTHORS]
Update the list of contributors. Please let me know if I forgot
someone.
* [if1632/*.spec] [if1632/builtin.c] [tools/build.c]
Ordinal base for Win32 DLLs is now computed automatically from the
lowest ordinal found.
* [include/wintypes.h]
WINAPI is now defined as attribute((stdcall)). This will require
gcc to compile.
* [if1632/thunk.c]
Removed Win32 thunks (no longer needed with stdcall).
* [if1632/crtdll.spec] [misc/crtdll.c]
Make sure we only reference cdecl functions in the spec file.
* [objects/dc.c]
Use CapNotLast drawing style for 1-pixel wide lines.
* [tools/build.c]
Added 'double' argument type.
Added 'varargs' function type for Win32.
Made CallTo16_xxx functions stdcall.
Fri Sep 5 14:50:49 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [tools/build.c] [windows/win.c] [windows/event.c] [windows/message.c]
More fixes to get message exchange closer to the original.
* [misc/spy.c]
Message logs now contain window names.
* [loader/resource.c] [loader/ne_resource.c] [loader/task.c]
[objects/cursoricon.c] [windows/user.c]
Added some obscure features to fix memory leaks.
Fri Sep 5 00:46:28 1997 Jan Willamowius <jan@janhh.shnet.org>
* [if1632/kernel32.spec] [win32/newfns.c]
Added stub for UTRegister() and UTUnRegister().
Thu Sep 4 12:03:12 1997 Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
* [controls/edit.c]
Allow ASCII codes > 127 in WM_CHAR.
Mon Sep 1 17:23:24 1997 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/widgets.c]
In InitCommonControls, remember the name of the class
because lpszClassName was made to point to a local array
Added the ProgressBar to the list of implemented controls.
Call InitCommonControls from WIDGETS_Init to register all
implemented Common Controls.
* [include/commctrl.h]
Added misc decl for the Progress Bar.
* [controls/progress.c] [include/progress.h]
First attempt at implementiong the Progress Bar class.
* [objects/brush.h]
Implementation for GetSysColorBrush[16|32]
* [controls/status.c]
Use DrawEdge to draw the borders and fill the background
* [controls/uitools.c]
Added DrawDiagEdge32 and DrawRectEdge32
* [graphics/painting.c]
Implement DrawEdge[16|32]
Started DrawFrameControl32
Mon Sep 1 10:07:09 1997 Lawson Whitney <lawson_whitney@juno.com>
* [misc/comm.c] [include/windows.h]
SetCommEventMask returns a SEGPTR.
Sun Aug 31 23:28:32 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][loader/module.c][include/pe_image.h]
[include/module.h]
Cleaned up the whole Win32 library mess (a bit).
* [debugger/stabs.c]
If 'wine' has no absolute path and isn't found, check $PATH too.
* [misc/ole2nls.c]
Some fixes.
* [misc/ver.c]
Added support for PE style version resources.
* [memory/string.c]
Check for NULL pointers to _lstr* functions, just as Windows95 does.
* [multimedia/time.c]
Made list of timers a simple linked list.
* [loader/resource.c]
Netscape 3 seems to pass NEGATIVE resource Ids (in an
unsigned int, yes). Don't know why, fixed it anyway.
* [objects/bitmap.c]
LoadImageW added.
* [include/win.h][windows/win.c]
Change wIDmenu from UINT16 to UINT32 and changed the
SetWindow(Long|Word) accordingly.
Thu Aug 28 19:30:08 1997 Morten Welinder <terra@diku.dk>
* [include/windows.h]
Add a few more colors defined for Win95.
Add a few more brush styles.
* [windows/syscolor.c]
Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
GetSysColor16, GetSysColor32. Add support for above colors.
Sun Aug 24 16:22:57 1997 Andrew Taylor <andrew@riscan.com>
* [multimedia/mmsystem.c]
Changed mmioDescend to use mmio functions for file I/O, neccessary
for memory files.
1997-09-14 19:17:23 +02:00
|
|
|
}
|
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
/******************************************************************************
|
2005-01-14 18:05:36 +01:00
|
|
|
* CoCreateGuid [OLE32.@]
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* Simply forwards to UuidCreate in RPCRT4.
|
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* pguid [O] Points to the GUID to initialize.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* SEE ALSO
|
|
|
|
* UuidCreate
|
Release 970914
Thu Sep 11 18:24:56 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* [objects/dc.c]
In DC_SetupGCForPatBlt, replace R2_NOT by GXxor with (black xor white).
Tue Sep 9 23:04:02 1997 U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [memory/virtual.c]
Do not write debugging info unconditionally to stderr.
* [files/profile.c]
Call PROFILE_GetSection in PROFILE_GetString for key_name "" too.
* [misc/crtdll.c]
Many new functions.
* [include/windows.h] [windows/winpos.c]
ClientToScreen16 doesn't have a return value.
Sun Sep 7 10:06:39 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [misc/main.c] [AUTHORS]
Update the list of contributors. Please let me know if I forgot
someone.
* [if1632/*.spec] [if1632/builtin.c] [tools/build.c]
Ordinal base for Win32 DLLs is now computed automatically from the
lowest ordinal found.
* [include/wintypes.h]
WINAPI is now defined as attribute((stdcall)). This will require
gcc to compile.
* [if1632/thunk.c]
Removed Win32 thunks (no longer needed with stdcall).
* [if1632/crtdll.spec] [misc/crtdll.c]
Make sure we only reference cdecl functions in the spec file.
* [objects/dc.c]
Use CapNotLast drawing style for 1-pixel wide lines.
* [tools/build.c]
Added 'double' argument type.
Added 'varargs' function type for Win32.
Made CallTo16_xxx functions stdcall.
Fri Sep 5 14:50:49 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [tools/build.c] [windows/win.c] [windows/event.c] [windows/message.c]
More fixes to get message exchange closer to the original.
* [misc/spy.c]
Message logs now contain window names.
* [loader/resource.c] [loader/ne_resource.c] [loader/task.c]
[objects/cursoricon.c] [windows/user.c]
Added some obscure features to fix memory leaks.
Fri Sep 5 00:46:28 1997 Jan Willamowius <jan@janhh.shnet.org>
* [if1632/kernel32.spec] [win32/newfns.c]
Added stub for UTRegister() and UTUnRegister().
Thu Sep 4 12:03:12 1997 Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
* [controls/edit.c]
Allow ASCII codes > 127 in WM_CHAR.
Mon Sep 1 17:23:24 1997 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/widgets.c]
In InitCommonControls, remember the name of the class
because lpszClassName was made to point to a local array
Added the ProgressBar to the list of implemented controls.
Call InitCommonControls from WIDGETS_Init to register all
implemented Common Controls.
* [include/commctrl.h]
Added misc decl for the Progress Bar.
* [controls/progress.c] [include/progress.h]
First attempt at implementiong the Progress Bar class.
* [objects/brush.h]
Implementation for GetSysColorBrush[16|32]
* [controls/status.c]
Use DrawEdge to draw the borders and fill the background
* [controls/uitools.c]
Added DrawDiagEdge32 and DrawRectEdge32
* [graphics/painting.c]
Implement DrawEdge[16|32]
Started DrawFrameControl32
Mon Sep 1 10:07:09 1997 Lawson Whitney <lawson_whitney@juno.com>
* [misc/comm.c] [include/windows.h]
SetCommEventMask returns a SEGPTR.
Sun Aug 31 23:28:32 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][loader/module.c][include/pe_image.h]
[include/module.h]
Cleaned up the whole Win32 library mess (a bit).
* [debugger/stabs.c]
If 'wine' has no absolute path and isn't found, check $PATH too.
* [misc/ole2nls.c]
Some fixes.
* [misc/ver.c]
Added support for PE style version resources.
* [memory/string.c]
Check for NULL pointers to _lstr* functions, just as Windows95 does.
* [multimedia/time.c]
Made list of timers a simple linked list.
* [loader/resource.c]
Netscape 3 seems to pass NEGATIVE resource Ids (in an
unsigned int, yes). Don't know why, fixed it anyway.
* [objects/bitmap.c]
LoadImageW added.
* [include/win.h][windows/win.c]
Change wIDmenu from UINT16 to UINT32 and changed the
SetWindow(Long|Word) accordingly.
Thu Aug 28 19:30:08 1997 Morten Welinder <terra@diku.dk>
* [include/windows.h]
Add a few more colors defined for Win95.
Add a few more brush styles.
* [windows/syscolor.c]
Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
GetSysColor16, GetSysColor32. Add support for above colors.
Sun Aug 24 16:22:57 1997 Andrew Taylor <andrew@riscan.com>
* [multimedia/mmsystem.c]
Changed mmioDescend to use mmio functions for file I/O, neccessary
for memory files.
1997-09-14 19:17:23 +02:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
HRESULT WINAPI CoCreateGuid(GUID *pguid)
|
|
|
|
{
|
2014-06-07 19:24:28 +02:00
|
|
|
DWORD status;
|
|
|
|
|
|
|
|
if(!pguid) return E_INVALIDARG;
|
|
|
|
|
|
|
|
status = UuidCreate(pguid);
|
2008-06-24 11:50:42 +02:00
|
|
|
if (status == RPC_S_OK || status == RPC_S_UUID_LOCAL_ONLY) return S_OK;
|
|
|
|
return HRESULT_FROM_WIN32( status );
|
Release 950403
Sun Apr 2 18:31:12 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [Configure] [if1632/Imakefile]
Removed new build and short names options.
* [if1632/*.c] [tools/build.c]
Implemented compiled call-back functions for better performance;
all the relay code is now done in assembly code generated by the
build program.
Relay code is no longer dependent on being loaded below 64K.
* [loader/resource.c]
Fixed memory leak in LoadString(). A fix will also be needed for
other resources.
* [memory/global.c]
Implemented global heap arenas, so we can store informations about
global blocks, like lock counts or owner handle.
Implemented FarGetOwner() and FarSetOwner().
Implemented global heap TOOLHELP functions.
* [memory/selector.c]
Bug fix: it was not possible to re-use a free selector.
Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis (csapuntz@mit.edu)
* [controls/listbox.c]
Major work on listbox code
- Many bugs fixed (still many bugs)
- More messages supported
- Code simplified
Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)
* [controls/edit.c]
Lots of bug fixes related to diappearing text, lost carets,
highlighting, segmentation faults, occurance of random
characters, insertion of characters over selection, misplaced
caret location, display corruption, end of line behavior, etc.
* [controls/widgets.c]
EDIT class doesn't want to use CS_PARENTDC flag.
Thu Mar 30 20:58:25 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [loader/selector.c]
FixupFunctionPrologs() should also handle multiple data modules.
(this bug only became visible because MakeProcInstance() was fixed
in 950319)
* [misc/dosfs.c]
Simplified DOS_SimplifyPath.
Small fix to DOS_opendir to reuse an entry if an open directory
is opened again, to prevent "too many open directories" messages.
Thu Mar 30 12:05:05 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
CoDisconnectObject: new stub function
* [include/msdos.h]
fix DOSVERSION
* [loader/ne_image.c]
NE_FixupSegment: Be more generous on additive fixups
* [if1632/user.spec][misc/network.c]
Add more WNet* stubs
Wed Mar 29 11:47:22 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c]
DlgDirList(): send segptr instead of linear pointer
in message to static control
* [controls/menu.c]
Tried to implement ownerdrawn menuitems. Doesn't work.
* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
Provide a stub for GetRasterizerCaps()
* [loader/selector.c]
Pass end address instead of length to LocalInit() in
CreateSelectors()
* [memory/local.c]
LocalInit(): If there's already a local heap in the segment, do
nothing and return TRUE
* [objects/linedda.c]
Replaced buggy LineDDA() with a Bresenham algorithm. Should work
now.
* [windows/cursor.c]
LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
more work still.
Tue Mar 21 17:54:43 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
[if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
[controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
[windows/nonclient.c] [misc/message.c]
Added a new builtin DLL that provides 16 bit entry points for all
the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
again.
* [misc/shell.c]
RegOpenKey()/RegCreateKey() bugs fixed.
* [loader/ne_image.c]
Skipping the initialization of a DLL when CS == 0 was broken.
1995-04-03 18:55:37 +02:00
|
|
|
}
|
1997-08-04 18:34:36 +02:00
|
|
|
|
2011-04-28 15:11:03 +02:00
|
|
|
static inline BOOL is_valid_hex(WCHAR c)
|
|
|
|
{
|
|
|
|
if (!(((c >= '0') && (c <= '9')) ||
|
|
|
|
((c >= 'a') && (c <= 'f')) ||
|
|
|
|
((c >= 'A') && (c <= 'F'))))
|
|
|
|
return FALSE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2014-02-11 05:34:41 +01:00
|
|
|
static const BYTE guid_conv_table[256] =
|
|
|
|
{
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, /* 0x30 */
|
|
|
|
0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
|
|
|
|
0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf /* 0x60 */
|
|
|
|
};
|
|
|
|
|
2014-02-09 14:57:36 +01:00
|
|
|
/* conversion helper for CLSIDFromString/IIDFromString */
|
|
|
|
static BOOL guid_from_string(LPCWSTR s, GUID *id)
|
2002-08-03 02:17:10 +02:00
|
|
|
{
|
1997-08-04 18:34:36 +02:00
|
|
|
int i;
|
|
|
|
|
2011-04-28 15:11:03 +02:00
|
|
|
if (!s || s[0]!='{') {
|
2005-08-22 11:19:38 +02:00
|
|
|
memset( id, 0, sizeof (CLSID) );
|
2014-02-09 14:57:36 +01:00
|
|
|
if(!s) return TRUE;
|
|
|
|
return FALSE;
|
2000-06-20 22:49:53 +02:00
|
|
|
}
|
2000-02-07 23:20:44 +01:00
|
|
|
|
2006-01-09 18:40:17 +01:00
|
|
|
TRACE("%s -> %p\n", debugstr_w(s), id);
|
1997-08-04 18:34:36 +02:00
|
|
|
|
|
|
|
/* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */
|
|
|
|
|
2011-04-28 15:11:03 +02:00
|
|
|
id->Data1 = 0;
|
|
|
|
for (i = 1; i < 9; i++) {
|
2014-02-09 14:57:36 +01:00
|
|
|
if (!is_valid_hex(s[i])) return FALSE;
|
2014-02-11 05:34:41 +01:00
|
|
|
id->Data1 = (id->Data1 << 4) | guid_conv_table[s[i]];
|
2011-04-28 15:11:03 +02:00
|
|
|
}
|
2014-02-09 14:57:36 +01:00
|
|
|
if (s[9]!='-') return FALSE;
|
2011-04-28 15:11:03 +02:00
|
|
|
|
|
|
|
id->Data2 = 0;
|
|
|
|
for (i = 10; i < 14; i++) {
|
2014-02-09 14:57:36 +01:00
|
|
|
if (!is_valid_hex(s[i])) return FALSE;
|
2014-02-11 05:34:41 +01:00
|
|
|
id->Data2 = (id->Data2 << 4) | guid_conv_table[s[i]];
|
2011-04-28 15:11:03 +02:00
|
|
|
}
|
2014-02-09 14:57:36 +01:00
|
|
|
if (s[14]!='-') return FALSE;
|
2011-04-28 15:11:03 +02:00
|
|
|
|
|
|
|
id->Data3 = 0;
|
|
|
|
for (i = 15; i < 19; i++) {
|
2014-02-09 14:57:36 +01:00
|
|
|
if (!is_valid_hex(s[i])) return FALSE;
|
2014-02-11 05:34:41 +01:00
|
|
|
id->Data3 = (id->Data3 << 4) | guid_conv_table[s[i]];
|
2011-04-28 15:11:03 +02:00
|
|
|
}
|
2014-02-09 14:57:36 +01:00
|
|
|
if (s[19]!='-') return FALSE;
|
2011-04-28 15:11:03 +02:00
|
|
|
|
|
|
|
for (i = 20; i < 37; i+=2) {
|
|
|
|
if (i == 24) {
|
2014-02-09 14:57:36 +01:00
|
|
|
if (s[i]!='-') return FALSE;
|
2011-04-28 15:11:03 +02:00
|
|
|
i++;
|
|
|
|
}
|
2014-02-09 14:57:36 +01:00
|
|
|
if (!is_valid_hex(s[i]) || !is_valid_hex(s[i+1])) return FALSE;
|
2014-02-11 05:34:41 +01:00
|
|
|
id->Data4[(i-20)/2] = guid_conv_table[s[i]] << 4 | guid_conv_table[s[i+1]];
|
2011-04-28 15:11:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (s[37] == '}' && s[38] == '\0')
|
2014-02-09 14:57:36 +01:00
|
|
|
return TRUE;
|
2011-04-28 15:11:03 +02:00
|
|
|
|
2014-02-09 14:57:36 +01:00
|
|
|
return FALSE;
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
}
|
|
|
|
|
2002-08-09 03:07:29 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
2013-10-24 20:12:56 +02:00
|
|
|
static HRESULT clsid_from_string_reg(LPCOLESTR progid, CLSID *clsid)
|
|
|
|
{
|
|
|
|
static const WCHAR clsidW[] = { '\\','C','L','S','I','D',0 };
|
|
|
|
WCHAR buf2[CHARS_IN_GUID];
|
|
|
|
LONG buf2len = sizeof(buf2);
|
|
|
|
HKEY xhkey;
|
|
|
|
WCHAR *buf;
|
|
|
|
|
|
|
|
memset(clsid, 0, sizeof(*clsid));
|
|
|
|
buf = HeapAlloc( GetProcessHeap(),0,(strlenW(progid)+8) * sizeof(WCHAR) );
|
2014-02-09 14:57:36 +01:00
|
|
|
if (!buf) return E_OUTOFMEMORY;
|
2013-10-24 20:12:56 +02:00
|
|
|
strcpyW( buf, progid );
|
|
|
|
strcatW( buf, clsidW );
|
|
|
|
if (open_classes_key(HKEY_CLASSES_ROOT, buf, MAXIMUM_ALLOWED, &xhkey))
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(),0,buf);
|
|
|
|
WARN("couldn't open key for ProgID %s\n", debugstr_w(progid));
|
|
|
|
return CO_E_CLASSSTRING;
|
|
|
|
}
|
|
|
|
HeapFree(GetProcessHeap(),0,buf);
|
|
|
|
|
|
|
|
if (RegQueryValueW(xhkey,NULL,buf2,&buf2len))
|
|
|
|
{
|
|
|
|
RegCloseKey(xhkey);
|
|
|
|
WARN("couldn't query clsid value for ProgID %s\n", debugstr_w(progid));
|
|
|
|
return CO_E_CLASSSTRING;
|
|
|
|
}
|
|
|
|
RegCloseKey(xhkey);
|
2014-02-09 14:57:36 +01:00
|
|
|
return guid_from_string(buf2, clsid) ? S_OK : CO_E_CLASSSTRING;
|
2013-10-24 20:12:56 +02:00
|
|
|
}
|
|
|
|
|
2014-02-09 14:57:36 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* CLSIDFromString [OLE32.@]
|
|
|
|
*
|
|
|
|
* Converts a unique identifier from its string representation into
|
|
|
|
* the GUID struct.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* idstr [I] The string representation of the GUID.
|
|
|
|
* id [O] GUID converted from the string.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK on success
|
|
|
|
* CO_E_CLASSSTRING if idstr is not a valid CLSID
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* StringFromCLSID
|
|
|
|
*/
|
2010-03-26 18:59:50 +01:00
|
|
|
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id )
|
2002-01-01 01:24:30 +01:00
|
|
|
{
|
2014-02-09 14:57:36 +01:00
|
|
|
HRESULT ret = CO_E_CLASSSTRING;
|
|
|
|
CLSID tmp_id;
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
|
2006-08-16 13:29:17 +02:00
|
|
|
if (!id)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2014-02-09 14:57:36 +01:00
|
|
|
if (guid_from_string(idstr, id))
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
/* It appears a ProgID is also valid */
|
|
|
|
ret = clsid_from_string_reg(idstr, &tmp_id);
|
|
|
|
if(SUCCEEDED(ret))
|
|
|
|
*id = tmp_id;
|
|
|
|
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
return ret;
|
1997-08-04 18:34:36 +02:00
|
|
|
}
|
|
|
|
|
2014-02-09 14:57:36 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* IIDFromString [OLE32.@]
|
|
|
|
*
|
2015-03-18 08:44:56 +01:00
|
|
|
* Converts an interface identifier from its string representation to
|
2014-02-09 14:57:36 +01:00
|
|
|
* the IID struct.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* idstr [I] The string representation of the GUID.
|
|
|
|
* id [O] IID converted from the string.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK on success
|
|
|
|
* CO_E_IIDSTRING if idstr is not a valid IID
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* StringFromIID
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI IIDFromString(LPCOLESTR s, IID *iid)
|
|
|
|
{
|
|
|
|
TRACE("%s -> %p\n", debugstr_w(s), iid);
|
|
|
|
|
|
|
|
if (!s)
|
|
|
|
{
|
|
|
|
memset(iid, 0, sizeof(*iid));
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* length mismatch is a special case */
|
|
|
|
if (strlenW(s) + 1 != CHARS_IN_GUID)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (s[0] != '{')
|
|
|
|
return CO_E_IIDSTRING;
|
|
|
|
|
|
|
|
return guid_from_string(s, iid) ? S_OK : CO_E_IIDSTRING;
|
|
|
|
}
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* StringFromCLSID [OLE32.@]
|
|
|
|
* StringFromIID [OLE32.@]
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
1998-03-29 21:44:57 +02:00
|
|
|
* Converts a GUID into the respective string representation.
|
|
|
|
* The target string is allocated using the OLE IMalloc.
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* id [I] the GUID to be converted.
|
|
|
|
* idstr [O] A pointer to a to-be-allocated pointer pointing to the resulting string.
|
|
|
|
*
|
1998-03-29 21:44:57 +02:00
|
|
|
* RETURNS
|
2004-11-29 18:00:15 +01:00
|
|
|
* S_OK
|
|
|
|
* E_FAIL
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* StringFromGUID2, CLSIDFromString
|
1998-03-29 21:44:57 +02:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
|
|
|
|
{
|
2014-02-09 14:56:38 +01:00
|
|
|
if (!(*idstr = CoTaskMemAlloc(CHARS_IN_GUID * sizeof(WCHAR)))) return E_OUTOFMEMORY;
|
2009-03-11 17:28:21 +01:00
|
|
|
StringFromGUID2( id, *idstr, CHARS_IN_GUID );
|
|
|
|
return S_OK;
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
}
|
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* StringFromGUID2 [OLE32.@]
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* Modified version of StringFromCLSID that allows you to specify max
|
|
|
|
* buffer size.
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* id [I] GUID to convert to string.
|
|
|
|
* str [O] Buffer where the result will be stored.
|
|
|
|
* cmax [I] Size of the buffer in characters.
|
|
|
|
*
|
1998-04-13 14:21:30 +02:00
|
|
|
* RETURNS
|
2005-01-14 18:05:36 +01:00
|
|
|
* Success: The length of the resulting string in characters.
|
|
|
|
* Failure: 0.
|
1998-03-29 21:44:57 +02:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
|
1998-03-29 21:44:57 +02:00
|
|
|
{
|
2009-03-11 17:28:21 +01:00
|
|
|
static const WCHAR formatW[] = { '{','%','0','8','X','-','%','0','4','X','-',
|
|
|
|
'%','0','4','X','-','%','0','2','X','%','0','2','X','-',
|
|
|
|
'%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',
|
|
|
|
'%','0','2','X','%','0','2','X','}',0 };
|
2009-10-05 21:06:22 +02:00
|
|
|
if (!id || cmax < CHARS_IN_GUID) return 0;
|
2009-03-11 17:28:21 +01:00
|
|
|
sprintfW( str, formatW, id->Data1, id->Data2, id->Data3,
|
|
|
|
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
|
|
|
|
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
|
|
|
|
return CHARS_IN_GUID;
|
1998-03-15 21:29:56 +01:00
|
|
|
}
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
/* open HKCR\\CLSID\\{string form of clsid}\\{keyname} key */
|
|
|
|
HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey)
|
2005-06-20 12:33:17 +02:00
|
|
|
{
|
|
|
|
static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0};
|
|
|
|
WCHAR path[CHARS_IN_GUID + ARRAYSIZE(wszCLSIDSlash) - 1];
|
2005-11-09 11:29:11 +01:00
|
|
|
LONG res;
|
|
|
|
HKEY key;
|
|
|
|
|
2005-06-20 12:33:17 +02:00
|
|
|
strcpyW(path, wszCLSIDSlash);
|
|
|
|
StringFromGUID2(clsid, path + strlenW(wszCLSIDSlash), CHARS_IN_GUID);
|
2012-11-26 15:20:48 +01:00
|
|
|
res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key);
|
2005-11-09 11:29:11 +01:00
|
|
|
if (res == ERROR_FILE_NOT_FOUND)
|
|
|
|
return REGDB_E_CLASSNOTREG;
|
|
|
|
else if (res != ERROR_SUCCESS)
|
|
|
|
return REGDB_E_READREGDB;
|
|
|
|
|
|
|
|
if (!keyname)
|
|
|
|
{
|
|
|
|
*subkey = key;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-11-26 15:20:48 +01:00
|
|
|
res = open_classes_key(key, keyname, access, subkey);
|
2005-11-09 11:29:11 +01:00
|
|
|
RegCloseKey(key);
|
2006-08-26 12:55:16 +02:00
|
|
|
if (res == ERROR_FILE_NOT_FOUND)
|
|
|
|
return REGDB_E_KEYMISSING;
|
|
|
|
else if (res != ERROR_SUCCESS)
|
|
|
|
return REGDB_E_READREGDB;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* open HKCR\\AppId\\{string form of appid clsid} key */
|
|
|
|
HRESULT COM_OpenKeyForAppIdFromCLSID(REFCLSID clsid, REGSAM access, HKEY *subkey)
|
|
|
|
{
|
|
|
|
static const WCHAR szAppId[] = { 'A','p','p','I','d',0 };
|
|
|
|
static const WCHAR szAppIdKey[] = { 'A','p','p','I','d','\\',0 };
|
|
|
|
DWORD res;
|
|
|
|
WCHAR buf[CHARS_IN_GUID];
|
|
|
|
WCHAR keyname[ARRAYSIZE(szAppIdKey) + CHARS_IN_GUID];
|
|
|
|
DWORD size;
|
|
|
|
HKEY hkey;
|
|
|
|
DWORD type;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
/* read the AppID value under the class's key */
|
2006-08-28 15:18:56 +02:00
|
|
|
hr = COM_OpenKeyForCLSID(clsid, NULL, KEY_READ, &hkey);
|
2006-08-26 12:55:16 +02:00
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
size = sizeof(buf);
|
2006-08-28 15:18:56 +02:00
|
|
|
res = RegQueryValueExW(hkey, szAppId, NULL, &type, (LPBYTE)buf, &size);
|
2006-08-26 12:55:16 +02:00
|
|
|
RegCloseKey(hkey);
|
|
|
|
if (res == ERROR_FILE_NOT_FOUND)
|
|
|
|
return REGDB_E_KEYMISSING;
|
|
|
|
else if (res != ERROR_SUCCESS || type!=REG_SZ)
|
|
|
|
return REGDB_E_READREGDB;
|
|
|
|
|
|
|
|
strcpyW(keyname, szAppIdKey);
|
|
|
|
strcatW(keyname, buf);
|
2012-11-26 15:20:48 +01:00
|
|
|
res = open_classes_key(HKEY_CLASSES_ROOT, keyname, access, subkey);
|
2005-11-09 11:29:11 +01:00
|
|
|
if (res == ERROR_FILE_NOT_FOUND)
|
|
|
|
return REGDB_E_KEYMISSING;
|
|
|
|
else if (res != ERROR_SUCCESS)
|
|
|
|
return REGDB_E_READREGDB;
|
|
|
|
|
|
|
|
return S_OK;
|
2005-06-20 12:33:17 +02:00
|
|
|
}
|
|
|
|
|
1999-10-31 03:24:51 +01:00
|
|
|
/******************************************************************************
|
2004-11-29 18:00:15 +01:00
|
|
|
* ProgIDFromCLSID [OLE32.@]
|
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Converts a class id into the respective program ID.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* clsid [I] Class ID, as found in registry.
|
2006-08-16 13:29:17 +02:00
|
|
|
* ppszProgID [O] Associated ProgID.
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK
|
|
|
|
* E_OUTOFMEMORY
|
|
|
|
* REGDB_E_CLASSNOTREG if the given clsid has no associated ProgID
|
1999-10-31 03:24:51 +01:00
|
|
|
*/
|
2013-12-20 01:16:29 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
|
1999-10-31 03:24:51 +01:00
|
|
|
{
|
2005-11-09 11:29:11 +01:00
|
|
|
static const WCHAR wszProgID[] = {'P','r','o','g','I','D',0};
|
2013-09-27 21:11:46 +02:00
|
|
|
ACTCTX_SECTION_KEYED_DATA data;
|
2005-11-09 11:29:11 +01:00
|
|
|
HKEY hkey;
|
|
|
|
HRESULT ret;
|
2005-08-15 12:49:39 +02:00
|
|
|
LONG progidlen = 0;
|
2005-06-20 12:33:17 +02:00
|
|
|
|
2006-08-16 13:29:17 +02:00
|
|
|
if (!ppszProgID)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*ppszProgID = NULL;
|
2013-09-27 21:11:46 +02:00
|
|
|
|
|
|
|
data.cbSize = sizeof(data);
|
|
|
|
if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
|
|
|
|
clsid, &data))
|
|
|
|
{
|
|
|
|
struct comclassredirect_data *comclass = (struct comclassredirect_data*)data.lpData;
|
|
|
|
if (comclass->progid_len)
|
|
|
|
{
|
|
|
|
WCHAR *ptrW;
|
|
|
|
|
|
|
|
*ppszProgID = CoTaskMemAlloc(comclass->progid_len + sizeof(WCHAR));
|
|
|
|
if (!*ppszProgID) return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
ptrW = (WCHAR*)((BYTE*)comclass + comclass->progid_offset);
|
|
|
|
memcpy(*ppszProgID, ptrW, comclass->progid_len + sizeof(WCHAR));
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return REGDB_E_CLASSNOTREG;
|
|
|
|
}
|
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
ret = COM_OpenKeyForCLSID(clsid, wszProgID, KEY_READ, &hkey);
|
|
|
|
if (FAILED(ret))
|
|
|
|
return ret;
|
|
|
|
|
2005-06-20 12:33:17 +02:00
|
|
|
if (RegQueryValueW(hkey, NULL, NULL, &progidlen))
|
1999-10-31 03:24:51 +01:00
|
|
|
ret = REGDB_E_CLASSNOTREG;
|
|
|
|
|
|
|
|
if (ret == S_OK)
|
|
|
|
{
|
2006-08-16 13:29:17 +02:00
|
|
|
*ppszProgID = CoTaskMemAlloc(progidlen * sizeof(WCHAR));
|
|
|
|
if (*ppszProgID)
|
1999-10-31 03:24:51 +01:00
|
|
|
{
|
2013-02-16 17:46:04 +01:00
|
|
|
if (RegQueryValueW(hkey, NULL, *ppszProgID, &progidlen)) {
|
2005-06-20 12:33:17 +02:00
|
|
|
ret = REGDB_E_CLASSNOTREG;
|
2013-02-16 17:46:04 +01:00
|
|
|
CoTaskMemFree(*ppszProgID);
|
|
|
|
*ppszProgID = NULL;
|
|
|
|
}
|
1999-10-31 03:24:51 +01:00
|
|
|
}
|
2005-06-20 12:33:17 +02:00
|
|
|
else
|
|
|
|
ret = E_OUTOFMEMORY;
|
1999-10-31 03:24:51 +01:00
|
|
|
}
|
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
RegCloseKey(hkey);
|
|
|
|
return ret;
|
1999-10-31 03:24:51 +01:00
|
|
|
}
|
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2005-01-14 18:05:36 +01:00
|
|
|
* CLSIDFromProgID [OLE32.@]
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Converts a program id into the respective GUID.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* progid [I] Unicode program ID, as found in registry.
|
2006-08-16 13:29:07 +02:00
|
|
|
* clsid [O] Associated CLSID.
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
1998-03-29 21:44:57 +02:00
|
|
|
* RETURNS
|
2005-01-14 18:05:36 +01:00
|
|
|
* Success: S_OK
|
|
|
|
* Failure: CO_E_CLASSSTRING - the given ProgID cannot be found.
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
*/
|
2013-12-20 01:16:29 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
|
2002-01-01 01:24:30 +01:00
|
|
|
{
|
2013-10-24 20:49:20 +02:00
|
|
|
ACTCTX_SECTION_KEYED_DATA data;
|
|
|
|
|
2006-08-16 13:29:07 +02:00
|
|
|
if (!progid || !clsid)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2013-10-24 20:49:20 +02:00
|
|
|
data.cbSize = sizeof(data);
|
|
|
|
if (FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION,
|
|
|
|
progid, &data))
|
|
|
|
{
|
|
|
|
struct progidredirect_data *progiddata = (struct progidredirect_data*)data.lpData;
|
|
|
|
CLSID *alias = (CLSID*)((BYTE*)data.lpSectionBase + progiddata->clsid_offset);
|
|
|
|
*clsid = *alias;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2013-10-24 20:12:56 +02:00
|
|
|
return clsid_from_string_reg(progid, clsid);
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
}
|
|
|
|
|
2013-05-07 04:51:36 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* CLSIDFromProgIDEx [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CLSIDFromProgIDEx(LPCOLESTR progid, LPCLSID clsid)
|
|
|
|
{
|
|
|
|
FIXME("%s,%p: semi-stub\n", debugstr_w(progid), clsid);
|
|
|
|
|
|
|
|
return CLSIDFromProgID(progid, clsid);
|
|
|
|
}
|
2000-09-01 03:21:08 +02:00
|
|
|
|
2014-07-15 12:34:41 +02:00
|
|
|
static HRESULT get_ps_clsid_from_registry(const WCHAR* path, REGSAM access, CLSID *pclsid)
|
|
|
|
{
|
|
|
|
HKEY hkey;
|
|
|
|
WCHAR value[CHARS_IN_GUID];
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
access |= KEY_READ;
|
|
|
|
|
|
|
|
if (open_classes_key(HKEY_CLASSES_ROOT, path, access, &hkey))
|
|
|
|
return REGDB_E_IIDNOTREG;
|
|
|
|
|
|
|
|
len = sizeof(value);
|
|
|
|
if (ERROR_SUCCESS != RegQueryValueExW(hkey, NULL, NULL, NULL, (BYTE *)value, &len))
|
|
|
|
return REGDB_E_IIDNOTREG;
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
|
|
|
|
if (CLSIDFromString(value, pclsid) != NOERROR)
|
|
|
|
return REGDB_E_IIDNOTREG;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2000-09-01 03:21:08 +02:00
|
|
|
/*****************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoGetPSClsid [OLE32.@]
|
2000-09-01 03:21:08 +02:00
|
|
|
*
|
2005-01-28 13:39:13 +01:00
|
|
|
* Retrieves the CLSID of the proxy/stub factory that implements
|
|
|
|
* IPSFactoryBuffer for the specified interface.
|
2000-09-01 03:21:08 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* riid [I] Interface whose proxy/stub CLSID is to be returned.
|
|
|
|
* pclsid [O] Where to store returned proxy/stub CLSID.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK
|
|
|
|
* E_OUTOFMEMORY
|
2005-01-28 13:39:13 +01:00
|
|
|
* REGDB_E_IIDNOTREG if no PSFactoryBuffer is associated with the IID, or it could not be parsed
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* The standard marshaller activates the object with the CLSID
|
|
|
|
* returned and uses the CreateProxy and CreateStub methods on its
|
|
|
|
* IPSFactoryBuffer interface to construct the proxies and stubs for a
|
|
|
|
* given object.
|
2004-07-06 23:27:48 +02:00
|
|
|
*
|
|
|
|
* CoGetPSClsid determines this CLSID by searching the
|
2004-11-29 18:00:15 +01:00
|
|
|
* HKEY_CLASSES_ROOT\Interface\{string form of riid}\ProxyStubClsid32
|
|
|
|
* in the registry and any interface id registered by
|
|
|
|
* CoRegisterPSClsid within the current process.
|
2001-09-11 02:26:12 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* BUGS
|
2004-11-29 18:00:15 +01:00
|
|
|
*
|
2006-07-20 20:30:21 +02:00
|
|
|
* Native returns S_OK for interfaces with a key in HKCR\Interface, but
|
2005-01-28 13:39:13 +01:00
|
|
|
* without a ProxyStubClsid32 key and leaves garbage in pclsid. This should be
|
|
|
|
* considered a bug in native unless an application depends on this (unlikely).
|
2006-07-20 20:30:21 +02:00
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoRegisterPSClsid.
|
2000-09-01 03:21:08 +02:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
|
2000-09-01 03:21:08 +02:00
|
|
|
{
|
2005-06-20 12:33:17 +02:00
|
|
|
static const WCHAR wszInterface[] = {'I','n','t','e','r','f','a','c','e','\\',0};
|
|
|
|
static const WCHAR wszPSC[] = {'\\','P','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0};
|
|
|
|
WCHAR path[ARRAYSIZE(wszInterface) - 1 + CHARS_IN_GUID - 1 + ARRAYSIZE(wszPSC)];
|
2006-07-20 20:30:21 +02:00
|
|
|
APARTMENT *apt = COM_CurrentApt();
|
|
|
|
struct registered_psclsid *registered_psclsid;
|
2013-09-27 20:59:03 +02:00
|
|
|
ACTCTX_SECTION_KEYED_DATA data;
|
2014-07-15 12:34:41 +02:00
|
|
|
HRESULT hr;
|
|
|
|
REGSAM opposite = (sizeof(void*) > sizeof(int)) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
|
|
|
|
BOOL is_wow64;
|
2000-09-01 03:21:08 +02:00
|
|
|
|
|
|
|
TRACE("() riid=%s, pclsid=%p\n", debugstr_guid(riid), pclsid);
|
|
|
|
|
2006-07-20 20:30:21 +02:00
|
|
|
if (!apt)
|
|
|
|
{
|
|
|
|
ERR("apartment not initialised\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
|
2006-08-16 13:29:17 +02:00
|
|
|
if (!pclsid)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
EnterCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
LIST_FOR_EACH_ENTRY(registered_psclsid, ®istered_psclsid_list, struct registered_psclsid, entry)
|
2006-07-20 20:30:21 +02:00
|
|
|
if (IsEqualIID(®istered_psclsid->iid, riid))
|
|
|
|
{
|
|
|
|
*pclsid = registered_psclsid->clsid;
|
2017-08-03 23:48:04 +02:00
|
|
|
LeaveCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
LeaveCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
|
2013-09-27 20:59:03 +02:00
|
|
|
data.cbSize = sizeof(data);
|
|
|
|
if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION,
|
|
|
|
riid, &data))
|
|
|
|
{
|
|
|
|
struct ifacepsredirect_data *ifaceps = (struct ifacepsredirect_data*)data.lpData;
|
|
|
|
*pclsid = ifaceps->iid;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-06-20 12:33:17 +02:00
|
|
|
/* Interface\\{string form of riid}\\ProxyStubClsid32 */
|
|
|
|
strcpyW(path, wszInterface);
|
|
|
|
StringFromGUID2(riid, path + ARRAYSIZE(wszInterface) - 1, CHARS_IN_GUID);
|
|
|
|
strcpyW(path + ARRAYSIZE(wszInterface) - 1 + CHARS_IN_GUID - 1, wszPSC);
|
2000-09-01 03:21:08 +02:00
|
|
|
|
2014-07-15 12:34:41 +02:00
|
|
|
hr = get_ps_clsid_from_registry(path, 0, pclsid);
|
|
|
|
if (FAILED(hr) && (opposite == KEY_WOW64_32KEY ||
|
|
|
|
(IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64)))
|
|
|
|
hr = get_ps_clsid_from_registry(path, opposite, pclsid);
|
2000-09-01 03:21:08 +02:00
|
|
|
|
2014-07-15 12:34:41 +02:00
|
|
|
if (hr == S_OK)
|
|
|
|
TRACE ("() Returning CLSID=%s\n", debugstr_guid(pclsid));
|
|
|
|
else
|
|
|
|
WARN("No PSFactoryBuffer object is registered for IID %s\n", debugstr_guid(riid));
|
2000-09-01 03:21:08 +02:00
|
|
|
|
2014-07-15 12:34:41 +02:00
|
|
|
return hr;
|
2000-09-01 03:21:08 +02:00
|
|
|
}
|
|
|
|
|
2006-07-20 20:30:21 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* CoRegisterPSClsid [OLE32.@]
|
|
|
|
*
|
|
|
|
* Register a proxy/stub CLSID for the given interface in the current process
|
|
|
|
* only.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* riid [I] Interface whose proxy/stub CLSID is to be registered.
|
|
|
|
* rclsid [I] CLSID of the proxy/stub.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK
|
|
|
|
* Failure: E_OUTOFMEMORY
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
*
|
2017-08-03 23:48:04 +02:00
|
|
|
* Unlike CoRegisterClassObject(), CLSIDs registered with CoRegisterPSClsid()
|
|
|
|
* will be returned from other apartments in the same process.
|
|
|
|
*
|
2006-07-20 20:30:21 +02:00
|
|
|
* This function does not add anything to the registry and the effects are
|
|
|
|
* limited to the lifetime of the current process.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoGetPSClsid.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid)
|
|
|
|
{
|
|
|
|
APARTMENT *apt = COM_CurrentApt();
|
|
|
|
struct registered_psclsid *registered_psclsid;
|
|
|
|
|
|
|
|
TRACE("(%s, %s)\n", debugstr_guid(riid), debugstr_guid(rclsid));
|
|
|
|
|
|
|
|
if (!apt)
|
|
|
|
{
|
|
|
|
ERR("apartment not initialised\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
EnterCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
LIST_FOR_EACH_ENTRY(registered_psclsid, ®istered_psclsid_list, struct registered_psclsid, entry)
|
2006-07-20 20:30:21 +02:00
|
|
|
if (IsEqualIID(®istered_psclsid->iid, riid))
|
|
|
|
{
|
|
|
|
registered_psclsid->clsid = *rclsid;
|
2017-08-03 23:48:04 +02:00
|
|
|
LeaveCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
registered_psclsid = HeapAlloc(GetProcessHeap(), 0, sizeof(struct registered_psclsid));
|
|
|
|
if (!registered_psclsid)
|
|
|
|
{
|
2017-08-03 23:48:04 +02:00
|
|
|
LeaveCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
registered_psclsid->iid = *riid;
|
|
|
|
registered_psclsid->clsid = *rclsid;
|
2017-08-03 23:48:04 +02:00
|
|
|
list_add_head(®istered_psclsid_list, ®istered_psclsid->entry);
|
2006-07-20 20:30:21 +02:00
|
|
|
|
2017-08-03 23:48:04 +02:00
|
|
|
LeaveCriticalSection(&cs_registered_psclsid_list);
|
2006-07-20 20:30:21 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2000-09-01 03:21:08 +02:00
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
/***
|
|
|
|
* COM_GetRegisteredClassObject
|
|
|
|
*
|
2001-09-11 02:26:12 +02:00
|
|
|
* This internal method is used to scan the registered class list to
|
1999-01-30 14:36:55 +01:00
|
|
|
* find a class object.
|
|
|
|
*
|
2001-09-11 02:26:12 +02:00
|
|
|
* Params:
|
1999-01-30 14:36:55 +01:00
|
|
|
* rclsid Class ID of the class to find.
|
|
|
|
* dwClsContext Class context to match.
|
|
|
|
* ppv [out] returns a pointer to the class object. Complying
|
|
|
|
* to normal COM usage, this method will increase the
|
|
|
|
* reference count on this object.
|
|
|
|
*/
|
2007-06-28 22:32:45 +02:00
|
|
|
static HRESULT COM_GetRegisteredClassObject(const struct apartment *apt, REFCLSID rclsid,
|
|
|
|
DWORD dwClsContext, LPUNKNOWN* ppUnk)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
2001-09-11 02:26:12 +02:00
|
|
|
HRESULT hr = S_FALSE;
|
2007-03-09 19:54:07 +01:00
|
|
|
RegisteredClass *curClass;
|
2001-09-11 02:26:12 +02:00
|
|
|
|
2007-03-09 19:54:07 +01:00
|
|
|
EnterCriticalSection( &csRegisteredClassList );
|
1999-01-30 14:36:55 +01:00
|
|
|
|
2007-03-09 19:54:07 +01:00
|
|
|
LIST_FOR_EACH_ENTRY(curClass, &RegisteredClassList, RegisteredClass, entry)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
|
|
|
/*
|
2007-03-05 21:45:49 +01:00
|
|
|
* Check if we have a match on the class ID and context.
|
1999-01-30 14:36:55 +01:00
|
|
|
*/
|
2007-05-08 00:59:09 +02:00
|
|
|
if ((apt->oxid == curClass->apartment_id) &&
|
|
|
|
(dwClsContext & curClass->runContext) &&
|
2007-03-05 21:45:49 +01:00
|
|
|
IsEqualGUID(&(curClass->classIdentifier), rclsid))
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* We have a match, return the pointer to the class object.
|
|
|
|
*/
|
|
|
|
*ppUnk = curClass->classObject;
|
|
|
|
|
|
|
|
IUnknown_AddRef(curClass->classObject);
|
|
|
|
|
2001-09-11 02:26:12 +02:00
|
|
|
hr = S_OK;
|
2007-03-09 19:54:07 +01:00
|
|
|
break;
|
1999-01-30 14:36:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-09-11 02:26:12 +02:00
|
|
|
LeaveCriticalSection( &csRegisteredClassList );
|
2007-03-09 19:54:07 +01:00
|
|
|
|
2001-09-11 02:26:12 +02:00
|
|
|
return hr;
|
1999-01-30 14:36:55 +01:00
|
|
|
}
|
|
|
|
|
1998-10-11 16:21:42 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoRegisterClassObject [OLE32.@]
|
2005-01-05 18:14:33 +01:00
|
|
|
*
|
2004-12-27 20:24:55 +01:00
|
|
|
* Registers the class object for a given class ID. Servers housed in EXE
|
|
|
|
* files use this method instead of exporting DllGetClassObject to allow
|
|
|
|
* other code to connect to their objects.
|
1999-01-30 14:36:55 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* rclsid [I] CLSID of the object to register.
|
|
|
|
* pUnk [I] IUnknown of the object.
|
|
|
|
* dwClsContext [I] CLSCTX flags indicating the context in which to run the executable.
|
|
|
|
* flags [I] REGCLS flags indicating how connections are made.
|
|
|
|
* lpdwRegister [I] A unique cookie that can be passed to CoRevokeClassObject.
|
|
|
|
*
|
2004-11-29 18:00:15 +01:00
|
|
|
* RETURNS
|
2005-01-05 18:14:33 +01:00
|
|
|
* S_OK on success,
|
|
|
|
* E_INVALIDARG if lpdwRegister or pUnk are NULL,
|
2004-11-29 18:00:15 +01:00
|
|
|
* CO_E_OBJISREG if the object is already registered. We should not return this.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoRevokeClassObject, CoGetClassObject
|
2004-12-27 20:24:55 +01:00
|
|
|
*
|
2007-05-08 01:01:19 +02:00
|
|
|
* NOTES
|
|
|
|
* In-process objects are only registered for the current apartment.
|
|
|
|
* CoGetClassObject() and CoCreateInstance() will not return objects registered
|
|
|
|
* in other apartments.
|
|
|
|
*
|
2004-12-27 20:24:55 +01:00
|
|
|
* BUGS
|
|
|
|
* MSDN claims that multiple interface registrations are legal, but we
|
|
|
|
* can't do that with our current implementation.
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CoRegisterClassObject(
|
2005-01-14 18:05:36 +01:00
|
|
|
REFCLSID rclsid,
|
|
|
|
LPUNKNOWN pUnk,
|
|
|
|
DWORD dwClsContext,
|
|
|
|
DWORD flags,
|
|
|
|
LPDWORD lpdwRegister)
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
2009-12-09 12:04:01 +01:00
|
|
|
static LONG next_cookie;
|
1999-01-30 14:36:55 +01:00
|
|
|
RegisteredClass* newClass;
|
|
|
|
LPUNKNOWN foundObject;
|
|
|
|
HRESULT hr;
|
2007-05-08 00:57:31 +02:00
|
|
|
APARTMENT *apt;
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
TRACE("(%s,%p,0x%08x,0x%08x,%p)\n",
|
2002-02-05 19:11:17 +01:00
|
|
|
debugstr_guid(rclsid),pUnk,dwClsContext,flags,lpdwRegister);
|
1999-01-30 14:36:55 +01:00
|
|
|
|
|
|
|
if ( (lpdwRegister==0) || (pUnk==0) )
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2007-05-08 00:57:31 +02:00
|
|
|
apt = COM_CurrentApt();
|
|
|
|
if (!apt)
|
2004-12-27 20:21:47 +01:00
|
|
|
{
|
|
|
|
ERR("COM was not initialized\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
*lpdwRegister = 0;
|
|
|
|
|
2007-03-09 18:39:58 +01:00
|
|
|
/* REGCLS_MULTIPLEUSE implies registering as inproc server. This is what
|
|
|
|
* differentiates the flag from REGCLS_MULTI_SEPARATE. */
|
|
|
|
if (flags & REGCLS_MULTIPLEUSE)
|
|
|
|
dwClsContext |= CLSCTX_INPROC_SERVER;
|
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
/*
|
|
|
|
* First, check if the class is already registered.
|
|
|
|
* If it is, this should cause an error.
|
|
|
|
*/
|
2007-05-08 00:59:09 +02:00
|
|
|
hr = COM_GetRegisteredClassObject(apt, rclsid, dwClsContext, &foundObject);
|
2002-02-05 19:11:17 +01:00
|
|
|
if (hr == S_OK) {
|
2005-09-23 12:08:11 +02:00
|
|
|
if (flags & REGCLS_MULTIPLEUSE) {
|
|
|
|
if (dwClsContext & CLSCTX_LOCAL_SERVER)
|
|
|
|
hr = CoLockObjectExternal(foundObject, TRUE, FALSE);
|
|
|
|
IUnknown_Release(foundObject);
|
|
|
|
return hr;
|
|
|
|
}
|
1999-01-30 14:36:55 +01:00
|
|
|
IUnknown_Release(foundObject);
|
2005-09-23 12:08:11 +02:00
|
|
|
ERR("object already registered for class %s\n", debugstr_guid(rclsid));
|
1999-01-30 14:36:55 +01:00
|
|
|
return CO_E_OBJISREG;
|
|
|
|
}
|
2001-09-11 02:26:12 +02:00
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
newClass = HeapAlloc(GetProcessHeap(), 0, sizeof(RegisteredClass));
|
2001-09-11 02:26:12 +02:00
|
|
|
if ( newClass == NULL )
|
|
|
|
return E_OUTOFMEMORY;
|
1999-01-30 14:36:55 +01:00
|
|
|
|
|
|
|
newClass->classIdentifier = *rclsid;
|
2007-05-08 00:57:31 +02:00
|
|
|
newClass->apartment_id = apt->oxid;
|
1999-01-30 14:36:55 +01:00
|
|
|
newClass->runContext = dwClsContext;
|
|
|
|
newClass->connectFlags = flags;
|
2007-03-09 18:42:34 +01:00
|
|
|
newClass->RpcRegistration = NULL;
|
2005-07-19 13:40:22 +02:00
|
|
|
|
2009-12-09 12:04:01 +01:00
|
|
|
if (!(newClass->dwCookie = InterlockedIncrement( &next_cookie )))
|
|
|
|
newClass->dwCookie = InterlockedIncrement( &next_cookie );
|
1999-01-30 14:36:55 +01:00
|
|
|
|
|
|
|
/*
|
2000-06-23 17:33:31 +02:00
|
|
|
* Since we're making a copy of the object pointer, we have to increase its
|
1999-01-30 14:36:55 +01:00
|
|
|
* reference count.
|
|
|
|
*/
|
|
|
|
newClass->classObject = pUnk;
|
|
|
|
IUnknown_AddRef(newClass->classObject);
|
|
|
|
|
2007-03-09 19:54:07 +01:00
|
|
|
EnterCriticalSection( &csRegisteredClassList );
|
|
|
|
list_add_tail(&RegisteredClassList, &newClass->entry);
|
2001-09-11 02:26:12 +02:00
|
|
|
LeaveCriticalSection( &csRegisteredClassList );
|
|
|
|
|
1999-05-01 12:32:32 +02:00
|
|
|
*lpdwRegister = newClass->dwCookie;
|
2001-09-11 02:26:12 +02:00
|
|
|
|
2002-02-05 19:11:17 +01:00
|
|
|
if (dwClsContext & CLSCTX_LOCAL_SERVER) {
|
2013-05-23 13:20:41 +02:00
|
|
|
IStream *marshal_stream;
|
|
|
|
|
|
|
|
hr = get_local_server_stream(apt, &marshal_stream);
|
|
|
|
if(FAILED(hr))
|
2004-12-27 20:24:55 +01:00
|
|
|
return hr;
|
|
|
|
|
2007-03-09 18:42:34 +01:00
|
|
|
hr = RPC_StartLocalServer(&newClass->classIdentifier,
|
2013-05-23 13:20:41 +02:00
|
|
|
marshal_stream,
|
2007-03-09 18:51:36 +01:00
|
|
|
flags & (REGCLS_MULTIPLEUSE|REGCLS_MULTI_SEPARATE),
|
2007-03-09 18:42:34 +01:00
|
|
|
&newClass->RpcRegistration);
|
2013-05-23 13:20:41 +02:00
|
|
|
IStream_Release(marshal_stream);
|
2002-02-05 19:11:17 +01:00
|
|
|
}
|
1999-01-30 14:36:55 +01:00
|
|
|
return S_OK;
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
}
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
static enum comclass_threadingmodel get_threading_model(const struct class_reg_data *data)
|
2006-08-26 12:41:42 +02:00
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
if (data->hkey)
|
|
|
|
{
|
|
|
|
static const WCHAR wszThreadingModel[] = {'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0};
|
|
|
|
static const WCHAR wszApartment[] = {'A','p','a','r','t','m','e','n','t',0};
|
|
|
|
static const WCHAR wszFree[] = {'F','r','e','e',0};
|
|
|
|
static const WCHAR wszBoth[] = {'B','o','t','h',0};
|
|
|
|
WCHAR threading_model[10 /* strlenW(L"apartment")+1 */];
|
|
|
|
DWORD dwLength = sizeof(threading_model);
|
|
|
|
DWORD keytype;
|
|
|
|
DWORD ret;
|
|
|
|
|
|
|
|
ret = RegQueryValueExW(data->u.hkey, wszThreadingModel, NULL, &keytype, (BYTE*)threading_model, &dwLength);
|
|
|
|
if ((ret != ERROR_SUCCESS) || (keytype != REG_SZ))
|
|
|
|
threading_model[0] = '\0';
|
2006-08-26 12:41:42 +02:00
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
if (!strcmpiW(threading_model, wszApartment)) return ThreadingModel_Apartment;
|
|
|
|
if (!strcmpiW(threading_model, wszFree)) return ThreadingModel_Free;
|
|
|
|
if (!strcmpiW(threading_model, wszBoth)) return ThreadingModel_Both;
|
|
|
|
|
|
|
|
/* there's not specific handling for this case */
|
|
|
|
if (threading_model[0]) return ThreadingModel_Neutral;
|
|
|
|
return ThreadingModel_No;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return data->u.actctx.data->model;
|
2006-08-26 12:41:42 +02:00
|
|
|
}
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
static HRESULT get_inproc_class_object(APARTMENT *apt, const struct class_reg_data *regdata,
|
2007-11-30 19:08:08 +01:00
|
|
|
REFCLSID rclsid, REFIID riid,
|
|
|
|
BOOL hostifnecessary, void **ppv)
|
2005-11-09 11:29:11 +01:00
|
|
|
{
|
|
|
|
WCHAR dllpath[MAX_PATH+1];
|
2007-11-30 19:08:08 +01:00
|
|
|
BOOL apartment_threaded;
|
2005-11-09 11:29:11 +01:00
|
|
|
|
2007-11-30 19:08:08 +01:00
|
|
|
if (hostifnecessary)
|
2006-08-26 12:41:42 +02:00
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
enum comclass_threadingmodel model = get_threading_model(regdata);
|
2007-11-30 19:08:08 +01:00
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
if (model == ThreadingModel_Apartment)
|
2007-11-30 19:08:08 +01:00
|
|
|
{
|
|
|
|
apartment_threaded = TRUE;
|
|
|
|
if (apt->multi_threaded)
|
2013-09-27 06:47:15 +02:00
|
|
|
return apartment_hostobject_in_hostapt(apt, FALSE, FALSE, regdata, rclsid, riid, ppv);
|
2007-11-30 19:08:08 +01:00
|
|
|
}
|
2013-09-27 06:47:15 +02:00
|
|
|
else if (model == ThreadingModel_Free)
|
2007-11-30 19:08:08 +01:00
|
|
|
{
|
|
|
|
apartment_threaded = FALSE;
|
|
|
|
if (!apt->multi_threaded)
|
2013-09-27 06:47:15 +02:00
|
|
|
return apartment_hostobject_in_hostapt(apt, TRUE, FALSE, regdata, rclsid, riid, ppv);
|
2007-11-30 19:08:08 +01:00
|
|
|
}
|
|
|
|
/* everything except "Apartment", "Free" and "Both" */
|
2013-09-27 06:47:15 +02:00
|
|
|
else if (model != ThreadingModel_Both)
|
2007-11-30 19:08:08 +01:00
|
|
|
{
|
|
|
|
apartment_threaded = TRUE;
|
|
|
|
/* everything else is main-threaded */
|
2013-09-27 06:47:15 +02:00
|
|
|
if (model != ThreadingModel_No)
|
|
|
|
FIXME("unrecognised threading model %d for object %s, should be main-threaded?\n", model, debugstr_guid(rclsid));
|
2007-11-30 19:08:08 +01:00
|
|
|
|
|
|
|
if (apt->multi_threaded || !apt->main)
|
2013-09-27 06:47:15 +02:00
|
|
|
return apartment_hostobject_in_hostapt(apt, FALSE, TRUE, regdata, rclsid, riid, ppv);
|
2007-11-30 19:08:08 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
apartment_threaded = FALSE;
|
2006-08-26 12:41:42 +02:00
|
|
|
}
|
2007-11-30 19:08:08 +01:00
|
|
|
else
|
|
|
|
apartment_threaded = !apt->multi_threaded;
|
2006-08-26 12:41:42 +02:00
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
if (COM_RegReadPath(regdata, dllpath, ARRAYSIZE(dllpath)) != ERROR_SUCCESS)
|
2005-11-09 11:29:11 +01:00
|
|
|
{
|
|
|
|
/* failure: CLSID is not found in registry */
|
|
|
|
WARN("class %s not registered inproc\n", debugstr_guid(rclsid));
|
|
|
|
return REGDB_E_CLASSNOTREG;
|
|
|
|
}
|
|
|
|
|
2007-11-30 19:08:08 +01:00
|
|
|
return apartment_getclassobject(apt, dllpath, apartment_threaded,
|
2007-09-12 11:03:35 +02:00
|
|
|
rclsid, riid, ppv);
|
2005-11-09 11:29:11 +01:00
|
|
|
}
|
|
|
|
|
Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c] [include/file.h]
Fixed SetFilePointer to allow negative positions as in DOS.
* [graphics/ddraw.c]
Added some methods to IDirect3D.
* [ole/compobj.c] [if1632/compobj.spec]
Added/implemented CoCreateStandardMalloc16,
CoGetClassObject, CoCreateInstance,
LookupETask, SetETask, CoGetState16.
* [loader/task.c]
MakeProcInstance: return 0 if func == NULL.
* [*/*] [tools/winapi-check]
Added zillions of missing WINAPI's and __cdecl's.
(oops, several caused by myself)
Wrote script for automated checking.
* [if1632/compobj.spec]
Many stub names.
* [misc/ddeml.c] [ole/compobj.c]
Some stubs.
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
Added preliminary tab control support.
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
More changes to the PostScript driver:
Implemented pens and solid brushes.
Colour/greyscale for fonts, pens and brushes.
To get coloured output you need to have *ColorDevice set to true
in your PPD, otherwise you'll get greyscale.
Landscape mode now works, as does non-A4 page sizes.
Encoding of fonts to ANSI is better, Symbol works again.
* [objects/dc.c] [include/gdi.h] [*/*]
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
belong.
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
[msdos/int2f.c] [msdos/interrupts.c]
Fixed portability. Adapted some code to make it easier to
integrate the DOS subsystem with the DPMI subsystem, made
the DPMI simulated real-mode interrupts be handled the V86
way. Added support for .COM files. Made int2f DPMI check
fail, to avoid pkunzip crashing in attempting to use DPMI.
Generally moved stuff around a little.
It is now technically possible to load several DOS programs
into the same memory space. Not tested, though.
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/kernel.spec]
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
* [win32/except.c]
Fixed one bad program behaviour, (deleting SEH while in
first walk). RtlUnwind is broken too I think (it should unwind
on success, not while walking the exception chain).
* [ole/ole2nls.c]
Get*DefaultLCID returns 0x400|id. expected by one application.
* [if1632/snoop.c]
Handle non-standard SP returns more graceful.
* [windows/class.c]
hinstances are mostly irrelevant for win32.
* [memory/string.c] [misc/registry.c]
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
for registry.c)
Some small speedup hacks for registry.c
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/comctl32/Makefile.in]
Created dlls/comctl32 and moved the common controls stuff to it.
* [misc/version.c]
Removed COMCTL32_DllGetVersion. The fixed function is part
of the common controls stuff.
* [dlls/comctl32/*.c][include/commctrl.h]
Added structure size tests.
* [dlls/comctl32/toolbar.c]
Fixed a bug in TOOLBAR_GetMaxWidth().
* [dlls/comctl32/animate.c][include/animate.h]
[dlls/comctl32/comboex.c][include/comboex.h]
[dlls/comctl32/hotkey.c][include/hotkey.h]
[dlls/comctl32/listview.c][include/listview.h]
[dlls/comctl32/commctrl.c][include/commctrl.h]
New files. Added Animation, ComboBoxEx, Hotkey and
Listview control dummies.
* [dlls/comctl32/tooltips.c]
Fixed a display bug and font selection.
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
Added missing DPA functions. Fixed bugs and published the
function prototypes.
* [documentation/common_controls]
Updated.
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
* [AUTHORS] [include/authors.h]
Added myself as a Wine author.
* [memory/virtual.c] [objects/dc.c]
Fixed runtime errors for Solaris.
* [misc/ddeml.c] [objects/gdiobj.c]
Minor fixes.
* [win32/device.c]
Added stubs for IFSMgr VxDCall and
a partial implementation of IFSMgr DeviceIo.
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
[relay32/msnet32.spec] [relay32/oledlg.spec]
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
Added news files for implementation of IMM32.DLL.
All functions return 0 as is correct for all Western Languages.
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
Added new files for implementation of OLEDLG.DLL.
Added stubs with FIXME:s for all functions.
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
[documentation/shell32][include/shell.h]
Clean up, bugfixes.
* [dlls/shell32/enumidlist.c]
Fileattributes implemented.
* [dlls/shell32/pidl.c]
Class pidlmgr splited into functions, structures changed,
some functions rewritten.
* [dlls/shell32/shell32_main.c]
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
* [dlls/shell32/shellord.c][relay32/shell32.spec]
Parameter documented, implemented SHCloneSpecialIDList.
Stub improved ShellExecuteEx32A.
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
SHGetDataFromIDListA, SHFileOperationA.
* [include/winnls.h][include/ole2nls.c]
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
in OLE_GetFormatA, GetTimeFormat32A.
* [win32/code_page.c]
WideCharToMultiByte: parameter checking and returning of strlen
implemented.
* [windows/keyboard.c][windows/defwnd.c]
Debug messages added.
* [windows/win.c]
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
* [controls/menu.c]
Missing line added.
* [include/winerror.h]
Macros for SUCCEEDED and FAILED added.
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [loader/module.c]
Bugfix: LoadModule16 should *not* call LoadModule32.
* [files/dos_fs.c]
Bugfix: don't crash if given directory doesn't exist.
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
Almost completed implementation of [snd]PlaySound (except
flags SND_ALIAS_ID and SND_APPLICATION).
* [if1632/user.spec][windows/winpos.c]
Added SetWindowRgn16 stub.
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
* [files/drive.c]
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
existent drive.
* [msdos/int21.c]
INT21_FindFirstFCB: check drive validity to prevent oops.
* [win32/file.c]
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [files/dos_fs.c]
Make DOSFS_OpenDir treat "" as "/".
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [windows/dialog.c]
GetNextDlgTabItem32: use last/first item instead of first/last
when hwndCtrl==0. This fixes initial focus.
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
* [include/process.h] [include/process.c]
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
with thread constant, and Win32 documentation (which calls it
a pseudohandle.) Made GetCurrentProcess actually use this
constant instead of the value.
* [include/process.h] [include/thread.h] [scheduler/thread.c]
[scheduler/process.c] [scheduler/handle.c]
Modify HANDLE_GetObjPtr to understand about
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
This allows DuplicateHandle to do the correct thing with these
handles. Removed now duplicate functionality from THREAD_GetPtr
and PROCESS_GetPtr.
* [loader/ne/segment.c]
Fixed two places where HFILE32s were being created and passed to
16-bit code. This should unbreak NE self-loading code.
Added two casts to remove compile time warnings.
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
* [msdos/dosmem.c] [msdos/int2f.c]
Added beginnings of DOS error table.
* [msdos/int1a.c]
Stub for subfunction 0xb0.
* [msdos/int10.c] [loader/dos/dosvm.c]
INT 10 support completely rewritten and lots of debugging
added. Now, DOS apps that use INT 10 to write to the screen will
work. (Beyond Zork does, at least. Somewhat.)
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
Another shot at getting MS's generic error message facility
right.
* [msdos/int21.c]
Command.Com wanted to set its own PSP address. I let it.
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
* [include/file.h] [misc/lzexpand.c]
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
convert lzw handles.
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/registry.c]
In RegEnumvalue, ivalue == 0 is a legal request and should
return the first entry.
* [msdos/int21.c]
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
* [windows/winproc.c]
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [windows/win.c]
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
flag when a child window is reparented to the desktop window.
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
* [controls/menu.c]
Menus created with SetMenuItemInfo and InsertMenuItem should
work now.
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
* [controls/combo.c]
Added CB_GETITEMHEIGHT.
* [windows/winpos.c]
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [include/windows.h]
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
GetPrivateProfileStructW, GetProfileSectionW,
WriteProfileSection[AW], WritePrivateProfileStructW.
1998-09-13 18:32:00 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoGetClassObject [OLE32.@]
|
2002-01-18 19:09:37 +01:00
|
|
|
*
|
2007-03-26 19:24:27 +02:00
|
|
|
* Creates an object of the specified class.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* rclsid [I] Class ID to create an instance of.
|
|
|
|
* dwClsContext [I] Flags to restrict the location of the created instance.
|
|
|
|
* pServerInfo [I] Optional. Details for connecting to a remote server.
|
|
|
|
* iid [I] The ID of the interface of the instance to return.
|
|
|
|
* ppv [O] On returns, contains a pointer to the specified interface of the object.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* The dwClsContext parameter can be one or more of the following:
|
|
|
|
*| CLSCTX_INPROC_SERVER - Use an in-process server, such as from a DLL.
|
|
|
|
*| CLSCTX_INPROC_HANDLER - Use an in-process object which handles certain functions for an object running in another process.
|
|
|
|
*| CLSCTX_LOCAL_SERVER - Connect to an object running in another process.
|
|
|
|
*| CLSCTX_REMOTE_SERVER - Connect to an object running on another machine.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoCreateInstance()
|
Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c] [include/file.h]
Fixed SetFilePointer to allow negative positions as in DOS.
* [graphics/ddraw.c]
Added some methods to IDirect3D.
* [ole/compobj.c] [if1632/compobj.spec]
Added/implemented CoCreateStandardMalloc16,
CoGetClassObject, CoCreateInstance,
LookupETask, SetETask, CoGetState16.
* [loader/task.c]
MakeProcInstance: return 0 if func == NULL.
* [*/*] [tools/winapi-check]
Added zillions of missing WINAPI's and __cdecl's.
(oops, several caused by myself)
Wrote script for automated checking.
* [if1632/compobj.spec]
Many stub names.
* [misc/ddeml.c] [ole/compobj.c]
Some stubs.
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
Added preliminary tab control support.
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
More changes to the PostScript driver:
Implemented pens and solid brushes.
Colour/greyscale for fonts, pens and brushes.
To get coloured output you need to have *ColorDevice set to true
in your PPD, otherwise you'll get greyscale.
Landscape mode now works, as does non-A4 page sizes.
Encoding of fonts to ANSI is better, Symbol works again.
* [objects/dc.c] [include/gdi.h] [*/*]
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
belong.
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
[msdos/int2f.c] [msdos/interrupts.c]
Fixed portability. Adapted some code to make it easier to
integrate the DOS subsystem with the DPMI subsystem, made
the DPMI simulated real-mode interrupts be handled the V86
way. Added support for .COM files. Made int2f DPMI check
fail, to avoid pkunzip crashing in attempting to use DPMI.
Generally moved stuff around a little.
It is now technically possible to load several DOS programs
into the same memory space. Not tested, though.
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/kernel.spec]
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
* [win32/except.c]
Fixed one bad program behaviour, (deleting SEH while in
first walk). RtlUnwind is broken too I think (it should unwind
on success, not while walking the exception chain).
* [ole/ole2nls.c]
Get*DefaultLCID returns 0x400|id. expected by one application.
* [if1632/snoop.c]
Handle non-standard SP returns more graceful.
* [windows/class.c]
hinstances are mostly irrelevant for win32.
* [memory/string.c] [misc/registry.c]
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
for registry.c)
Some small speedup hacks for registry.c
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/comctl32/Makefile.in]
Created dlls/comctl32 and moved the common controls stuff to it.
* [misc/version.c]
Removed COMCTL32_DllGetVersion. The fixed function is part
of the common controls stuff.
* [dlls/comctl32/*.c][include/commctrl.h]
Added structure size tests.
* [dlls/comctl32/toolbar.c]
Fixed a bug in TOOLBAR_GetMaxWidth().
* [dlls/comctl32/animate.c][include/animate.h]
[dlls/comctl32/comboex.c][include/comboex.h]
[dlls/comctl32/hotkey.c][include/hotkey.h]
[dlls/comctl32/listview.c][include/listview.h]
[dlls/comctl32/commctrl.c][include/commctrl.h]
New files. Added Animation, ComboBoxEx, Hotkey and
Listview control dummies.
* [dlls/comctl32/tooltips.c]
Fixed a display bug and font selection.
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
Added missing DPA functions. Fixed bugs and published the
function prototypes.
* [documentation/common_controls]
Updated.
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
* [AUTHORS] [include/authors.h]
Added myself as a Wine author.
* [memory/virtual.c] [objects/dc.c]
Fixed runtime errors for Solaris.
* [misc/ddeml.c] [objects/gdiobj.c]
Minor fixes.
* [win32/device.c]
Added stubs for IFSMgr VxDCall and
a partial implementation of IFSMgr DeviceIo.
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
[relay32/msnet32.spec] [relay32/oledlg.spec]
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
Added news files for implementation of IMM32.DLL.
All functions return 0 as is correct for all Western Languages.
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
Added new files for implementation of OLEDLG.DLL.
Added stubs with FIXME:s for all functions.
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
[documentation/shell32][include/shell.h]
Clean up, bugfixes.
* [dlls/shell32/enumidlist.c]
Fileattributes implemented.
* [dlls/shell32/pidl.c]
Class pidlmgr splited into functions, structures changed,
some functions rewritten.
* [dlls/shell32/shell32_main.c]
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
* [dlls/shell32/shellord.c][relay32/shell32.spec]
Parameter documented, implemented SHCloneSpecialIDList.
Stub improved ShellExecuteEx32A.
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
SHGetDataFromIDListA, SHFileOperationA.
* [include/winnls.h][include/ole2nls.c]
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
in OLE_GetFormatA, GetTimeFormat32A.
* [win32/code_page.c]
WideCharToMultiByte: parameter checking and returning of strlen
implemented.
* [windows/keyboard.c][windows/defwnd.c]
Debug messages added.
* [windows/win.c]
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
* [controls/menu.c]
Missing line added.
* [include/winerror.h]
Macros for SUCCEEDED and FAILED added.
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [loader/module.c]
Bugfix: LoadModule16 should *not* call LoadModule32.
* [files/dos_fs.c]
Bugfix: don't crash if given directory doesn't exist.
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
Almost completed implementation of [snd]PlaySound (except
flags SND_ALIAS_ID and SND_APPLICATION).
* [if1632/user.spec][windows/winpos.c]
Added SetWindowRgn16 stub.
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
* [files/drive.c]
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
existent drive.
* [msdos/int21.c]
INT21_FindFirstFCB: check drive validity to prevent oops.
* [win32/file.c]
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [files/dos_fs.c]
Make DOSFS_OpenDir treat "" as "/".
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [windows/dialog.c]
GetNextDlgTabItem32: use last/first item instead of first/last
when hwndCtrl==0. This fixes initial focus.
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
* [include/process.h] [include/process.c]
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
with thread constant, and Win32 documentation (which calls it
a pseudohandle.) Made GetCurrentProcess actually use this
constant instead of the value.
* [include/process.h] [include/thread.h] [scheduler/thread.c]
[scheduler/process.c] [scheduler/handle.c]
Modify HANDLE_GetObjPtr to understand about
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
This allows DuplicateHandle to do the correct thing with these
handles. Removed now duplicate functionality from THREAD_GetPtr
and PROCESS_GetPtr.
* [loader/ne/segment.c]
Fixed two places where HFILE32s were being created and passed to
16-bit code. This should unbreak NE self-loading code.
Added two casts to remove compile time warnings.
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
* [msdos/dosmem.c] [msdos/int2f.c]
Added beginnings of DOS error table.
* [msdos/int1a.c]
Stub for subfunction 0xb0.
* [msdos/int10.c] [loader/dos/dosvm.c]
INT 10 support completely rewritten and lots of debugging
added. Now, DOS apps that use INT 10 to write to the screen will
work. (Beyond Zork does, at least. Somewhat.)
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
Another shot at getting MS's generic error message facility
right.
* [msdos/int21.c]
Command.Com wanted to set its own PSP address. I let it.
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
* [include/file.h] [misc/lzexpand.c]
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
convert lzw handles.
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/registry.c]
In RegEnumvalue, ivalue == 0 is a legal request and should
return the first entry.
* [msdos/int21.c]
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
* [windows/winproc.c]
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [windows/win.c]
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
flag when a child window is reparented to the desktop window.
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
* [controls/menu.c]
Menus created with SetMenuItemInfo and InsertMenuItem should
work now.
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
* [controls/combo.c]
Added CB_GETITEMHEIGHT.
* [windows/winpos.c]
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [include/windows.h]
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
GetPrivateProfileStructW, GetProfileSectionW,
WriteProfileSection[AW], WritePrivateProfileStructW.
1998-09-13 18:32:00 +02:00
|
|
|
*/
|
2013-12-20 01:16:29 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(
|
2001-04-09 20:33:49 +02:00
|
|
|
REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo,
|
2005-06-20 12:33:17 +02:00
|
|
|
REFIID iid, LPVOID *ppv)
|
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
struct class_reg_data clsreg;
|
|
|
|
IUnknown *regClassObject;
|
2000-03-04 20:24:25 +01:00
|
|
|
HRESULT hres = E_UNEXPECTED;
|
2007-05-08 00:59:09 +02:00
|
|
|
APARTMENT *apt;
|
2009-05-05 12:49:17 +02:00
|
|
|
BOOL release_apt = FALSE;
|
2000-03-04 20:24:25 +01:00
|
|
|
|
2009-06-09 13:00:30 +02:00
|
|
|
TRACE("CLSID: %s,IID: %s\n", debugstr_guid(rclsid), debugstr_guid(iid));
|
Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c] [include/file.h]
Fixed SetFilePointer to allow negative positions as in DOS.
* [graphics/ddraw.c]
Added some methods to IDirect3D.
* [ole/compobj.c] [if1632/compobj.spec]
Added/implemented CoCreateStandardMalloc16,
CoGetClassObject, CoCreateInstance,
LookupETask, SetETask, CoGetState16.
* [loader/task.c]
MakeProcInstance: return 0 if func == NULL.
* [*/*] [tools/winapi-check]
Added zillions of missing WINAPI's and __cdecl's.
(oops, several caused by myself)
Wrote script for automated checking.
* [if1632/compobj.spec]
Many stub names.
* [misc/ddeml.c] [ole/compobj.c]
Some stubs.
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
Added preliminary tab control support.
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
More changes to the PostScript driver:
Implemented pens and solid brushes.
Colour/greyscale for fonts, pens and brushes.
To get coloured output you need to have *ColorDevice set to true
in your PPD, otherwise you'll get greyscale.
Landscape mode now works, as does non-A4 page sizes.
Encoding of fonts to ANSI is better, Symbol works again.
* [objects/dc.c] [include/gdi.h] [*/*]
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
belong.
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
[msdos/int2f.c] [msdos/interrupts.c]
Fixed portability. Adapted some code to make it easier to
integrate the DOS subsystem with the DPMI subsystem, made
the DPMI simulated real-mode interrupts be handled the V86
way. Added support for .COM files. Made int2f DPMI check
fail, to avoid pkunzip crashing in attempting to use DPMI.
Generally moved stuff around a little.
It is now technically possible to load several DOS programs
into the same memory space. Not tested, though.
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/kernel.spec]
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
* [win32/except.c]
Fixed one bad program behaviour, (deleting SEH while in
first walk). RtlUnwind is broken too I think (it should unwind
on success, not while walking the exception chain).
* [ole/ole2nls.c]
Get*DefaultLCID returns 0x400|id. expected by one application.
* [if1632/snoop.c]
Handle non-standard SP returns more graceful.
* [windows/class.c]
hinstances are mostly irrelevant for win32.
* [memory/string.c] [misc/registry.c]
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
for registry.c)
Some small speedup hacks for registry.c
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/comctl32/Makefile.in]
Created dlls/comctl32 and moved the common controls stuff to it.
* [misc/version.c]
Removed COMCTL32_DllGetVersion. The fixed function is part
of the common controls stuff.
* [dlls/comctl32/*.c][include/commctrl.h]
Added structure size tests.
* [dlls/comctl32/toolbar.c]
Fixed a bug in TOOLBAR_GetMaxWidth().
* [dlls/comctl32/animate.c][include/animate.h]
[dlls/comctl32/comboex.c][include/comboex.h]
[dlls/comctl32/hotkey.c][include/hotkey.h]
[dlls/comctl32/listview.c][include/listview.h]
[dlls/comctl32/commctrl.c][include/commctrl.h]
New files. Added Animation, ComboBoxEx, Hotkey and
Listview control dummies.
* [dlls/comctl32/tooltips.c]
Fixed a display bug and font selection.
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
Added missing DPA functions. Fixed bugs and published the
function prototypes.
* [documentation/common_controls]
Updated.
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
* [AUTHORS] [include/authors.h]
Added myself as a Wine author.
* [memory/virtual.c] [objects/dc.c]
Fixed runtime errors for Solaris.
* [misc/ddeml.c] [objects/gdiobj.c]
Minor fixes.
* [win32/device.c]
Added stubs for IFSMgr VxDCall and
a partial implementation of IFSMgr DeviceIo.
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
[relay32/msnet32.spec] [relay32/oledlg.spec]
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
Added news files for implementation of IMM32.DLL.
All functions return 0 as is correct for all Western Languages.
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
Added new files for implementation of OLEDLG.DLL.
Added stubs with FIXME:s for all functions.
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
[documentation/shell32][include/shell.h]
Clean up, bugfixes.
* [dlls/shell32/enumidlist.c]
Fileattributes implemented.
* [dlls/shell32/pidl.c]
Class pidlmgr splited into functions, structures changed,
some functions rewritten.
* [dlls/shell32/shell32_main.c]
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
* [dlls/shell32/shellord.c][relay32/shell32.spec]
Parameter documented, implemented SHCloneSpecialIDList.
Stub improved ShellExecuteEx32A.
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
SHGetDataFromIDListA, SHFileOperationA.
* [include/winnls.h][include/ole2nls.c]
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
in OLE_GetFormatA, GetTimeFormat32A.
* [win32/code_page.c]
WideCharToMultiByte: parameter checking and returning of strlen
implemented.
* [windows/keyboard.c][windows/defwnd.c]
Debug messages added.
* [windows/win.c]
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
* [controls/menu.c]
Missing line added.
* [include/winerror.h]
Macros for SUCCEEDED and FAILED added.
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [loader/module.c]
Bugfix: LoadModule16 should *not* call LoadModule32.
* [files/dos_fs.c]
Bugfix: don't crash if given directory doesn't exist.
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
Almost completed implementation of [snd]PlaySound (except
flags SND_ALIAS_ID and SND_APPLICATION).
* [if1632/user.spec][windows/winpos.c]
Added SetWindowRgn16 stub.
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
* [files/drive.c]
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
existent drive.
* [msdos/int21.c]
INT21_FindFirstFCB: check drive validity to prevent oops.
* [win32/file.c]
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [files/dos_fs.c]
Make DOSFS_OpenDir treat "" as "/".
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [windows/dialog.c]
GetNextDlgTabItem32: use last/first item instead of first/last
when hwndCtrl==0. This fixes initial focus.
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
* [include/process.h] [include/process.c]
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
with thread constant, and Win32 documentation (which calls it
a pseudohandle.) Made GetCurrentProcess actually use this
constant instead of the value.
* [include/process.h] [include/thread.h] [scheduler/thread.c]
[scheduler/process.c] [scheduler/handle.c]
Modify HANDLE_GetObjPtr to understand about
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
This allows DuplicateHandle to do the correct thing with these
handles. Removed now duplicate functionality from THREAD_GetPtr
and PROCESS_GetPtr.
* [loader/ne/segment.c]
Fixed two places where HFILE32s were being created and passed to
16-bit code. This should unbreak NE self-loading code.
Added two casts to remove compile time warnings.
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
* [msdos/dosmem.c] [msdos/int2f.c]
Added beginnings of DOS error table.
* [msdos/int1a.c]
Stub for subfunction 0xb0.
* [msdos/int10.c] [loader/dos/dosvm.c]
INT 10 support completely rewritten and lots of debugging
added. Now, DOS apps that use INT 10 to write to the screen will
work. (Beyond Zork does, at least. Somewhat.)
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
Another shot at getting MS's generic error message facility
right.
* [msdos/int21.c]
Command.Com wanted to set its own PSP address. I let it.
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
* [include/file.h] [misc/lzexpand.c]
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
convert lzw handles.
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/registry.c]
In RegEnumvalue, ivalue == 0 is a legal request and should
return the first entry.
* [msdos/int21.c]
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
* [windows/winproc.c]
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [windows/win.c]
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
flag when a child window is reparented to the desktop window.
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
* [controls/menu.c]
Menus created with SetMenuItemInfo and InsertMenuItem should
work now.
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
* [controls/combo.c]
Added CB_GETITEMHEIGHT.
* [windows/winpos.c]
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [include/windows.h]
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
GetPrivateProfileStructW, GetProfileSectionW,
WriteProfileSection[AW], WritePrivateProfileStructW.
1998-09-13 18:32:00 +02:00
|
|
|
|
2006-07-14 01:02:24 +02:00
|
|
|
if (!ppv)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
2009-05-05 12:49:17 +02:00
|
|
|
if (!(apt = COM_CurrentApt()))
|
2006-07-14 01:02:24 +02:00
|
|
|
{
|
2009-05-05 12:49:17 +02:00
|
|
|
if (!(apt = apartment_find_multi_threaded()))
|
|
|
|
{
|
|
|
|
ERR("apartment not initialised\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
release_apt = TRUE;
|
2006-07-14 01:02:24 +02:00
|
|
|
}
|
|
|
|
|
2001-04-09 20:33:49 +02:00
|
|
|
if (pServerInfo) {
|
2009-06-09 13:00:30 +02:00
|
|
|
FIXME("pServerInfo->name=%s pAuthInfo=%p\n",
|
|
|
|
debugstr_w(pServerInfo->pwszName), pServerInfo->pAuthInfo);
|
2001-04-09 20:33:49 +02:00
|
|
|
}
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
if (CLSCTX_INPROC_SERVER & dwClsContext)
|
|
|
|
{
|
|
|
|
if (IsEqualCLSID(rclsid, &CLSID_InProcFreeMarshaler))
|
|
|
|
{
|
|
|
|
if (release_apt) apartment_release(apt);
|
|
|
|
return FTMarshalCF_Create(iid, ppv);
|
|
|
|
}
|
2017-02-22 12:28:57 +01:00
|
|
|
if (IsEqualCLSID(rclsid, &CLSID_GlobalOptions))
|
|
|
|
return IClassFactory_QueryInterface(&GlobalOptionsCF, iid, ppv);
|
2013-09-27 06:47:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (CLSCTX_INPROC & dwClsContext)
|
|
|
|
{
|
|
|
|
ACTCTX_SECTION_KEYED_DATA data;
|
|
|
|
|
|
|
|
data.cbSize = sizeof(data);
|
|
|
|
/* search activation context first */
|
|
|
|
if (FindActCtxSectionGuid(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
|
|
|
|
ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
|
|
|
|
rclsid, &data))
|
|
|
|
{
|
2013-11-01 13:12:47 +01:00
|
|
|
struct comclassredirect_data *comclass = (struct comclassredirect_data*)data.lpData;
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
clsreg.u.actctx.hactctx = data.hActCtx;
|
|
|
|
clsreg.u.actctx.data = data.lpData;
|
|
|
|
clsreg.u.actctx.section = data.lpSectionBase;
|
|
|
|
clsreg.hkey = FALSE;
|
|
|
|
|
2013-11-01 13:12:47 +01:00
|
|
|
hres = get_inproc_class_object(apt, &clsreg, &comclass->clsid, iid, !(dwClsContext & WINE_CLSCTX_DONT_HOST), ppv);
|
2013-09-27 06:47:15 +02:00
|
|
|
ReleaseActCtx(data.hActCtx);
|
|
|
|
if (release_apt) apartment_release(apt);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-01-30 14:36:55 +01:00
|
|
|
/*
|
2001-09-11 02:26:12 +02:00
|
|
|
* First, try and see if we can't match the class ID with one of the
|
1999-01-30 14:36:55 +01:00
|
|
|
* registered classes.
|
|
|
|
*/
|
2007-05-08 00:59:09 +02:00
|
|
|
if (S_OK == COM_GetRegisteredClassObject(apt, rclsid, dwClsContext,
|
|
|
|
®ClassObject))
|
1999-01-30 14:36:55 +01:00
|
|
|
{
|
2005-06-20 12:33:17 +02:00
|
|
|
/* Get the required interface from the retrieved pointer. */
|
1999-01-30 14:36:55 +01:00
|
|
|
hres = IUnknown_QueryInterface(regClassObject, iid, ppv);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Since QI got another reference on the pointer, we want to release the
|
|
|
|
* one we already have. If QI was unsuccessful, this will release the object. This
|
|
|
|
* is good since we are not returning it in the "out" parameter.
|
|
|
|
*/
|
|
|
|
IUnknown_Release(regClassObject);
|
2009-05-05 12:49:17 +02:00
|
|
|
if (release_apt) apartment_release(apt);
|
1999-01-30 14:36:55 +01:00
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2005-11-12 20:11:21 +01:00
|
|
|
/* First try in-process server */
|
|
|
|
if (CLSCTX_INPROC_SERVER & dwClsContext)
|
2005-06-20 12:33:17 +02:00
|
|
|
{
|
|
|
|
static const WCHAR wszInprocServer32[] = {'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
|
|
|
|
HKEY hkey;
|
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
hres = COM_OpenKeyForCLSID(rclsid, wszInprocServer32, KEY_READ, &hkey);
|
|
|
|
if (FAILED(hres))
|
2005-06-20 12:33:17 +02:00
|
|
|
{
|
2005-11-09 11:29:11 +01:00
|
|
|
if (hres == REGDB_E_CLASSNOTREG)
|
|
|
|
ERR("class %s not registered\n", debugstr_guid(rclsid));
|
2007-05-08 00:55:38 +02:00
|
|
|
else if (hres == REGDB_E_KEYMISSING)
|
|
|
|
{
|
2005-11-12 20:11:21 +01:00
|
|
|
WARN("class %s not registered as in-proc server\n", debugstr_guid(rclsid));
|
2007-05-08 00:55:38 +02:00
|
|
|
hres = REGDB_E_CLASSNOTREG;
|
|
|
|
}
|
2005-11-12 20:11:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (SUCCEEDED(hres))
|
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
clsreg.u.hkey = hkey;
|
|
|
|
clsreg.hkey = TRUE;
|
|
|
|
|
|
|
|
hres = get_inproc_class_object(apt, &clsreg, rclsid, iid, !(dwClsContext & WINE_CLSCTX_DONT_HOST), ppv);
|
2005-11-12 20:11:21 +01:00
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* return if we got a class, otherwise fall through to one of the
|
|
|
|
* other types */
|
|
|
|
if (SUCCEEDED(hres))
|
2009-05-05 12:49:17 +02:00
|
|
|
{
|
|
|
|
if (release_apt) apartment_release(apt);
|
2005-11-12 20:11:21 +01:00
|
|
|
return hres;
|
2009-05-05 12:49:17 +02:00
|
|
|
}
|
2005-11-12 20:11:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Next try in-process handler */
|
|
|
|
if (CLSCTX_INPROC_HANDLER & dwClsContext)
|
|
|
|
{
|
|
|
|
static const WCHAR wszInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
|
|
|
|
HKEY hkey;
|
|
|
|
|
|
|
|
hres = COM_OpenKeyForCLSID(rclsid, wszInprocHandler32, KEY_READ, &hkey);
|
|
|
|
if (FAILED(hres))
|
|
|
|
{
|
|
|
|
if (hres == REGDB_E_CLASSNOTREG)
|
|
|
|
ERR("class %s not registered\n", debugstr_guid(rclsid));
|
2007-05-08 00:55:38 +02:00
|
|
|
else if (hres == REGDB_E_KEYMISSING)
|
|
|
|
{
|
2005-11-12 20:11:21 +01:00
|
|
|
WARN("class %s not registered in-proc handler\n", debugstr_guid(rclsid));
|
2007-05-08 00:55:38 +02:00
|
|
|
hres = REGDB_E_CLASSNOTREG;
|
|
|
|
}
|
2005-06-20 12:33:17 +02:00
|
|
|
}
|
2002-08-03 02:17:10 +02:00
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
if (SUCCEEDED(hres))
|
2005-06-20 12:33:17 +02:00
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
clsreg.u.hkey = hkey;
|
|
|
|
clsreg.hkey = TRUE;
|
|
|
|
|
|
|
|
hres = get_inproc_class_object(apt, &clsreg, rclsid, iid, !(dwClsContext & WINE_CLSCTX_DONT_HOST), ppv);
|
2005-11-09 11:29:11 +01:00
|
|
|
RegCloseKey(hkey);
|
2005-06-20 12:33:17 +02:00
|
|
|
}
|
2005-11-09 11:29:11 +01:00
|
|
|
|
|
|
|
/* return if we got a class, otherwise fall through to one of the
|
|
|
|
* other types */
|
|
|
|
if (SUCCEEDED(hres))
|
2009-05-05 12:49:17 +02:00
|
|
|
{
|
|
|
|
if (release_apt) apartment_release(apt);
|
2005-11-09 11:29:11 +01:00
|
|
|
return hres;
|
2009-05-05 12:49:17 +02:00
|
|
|
}
|
2002-01-18 19:09:37 +01:00
|
|
|
}
|
2009-05-05 12:49:17 +02:00
|
|
|
if (release_apt) apartment_release(apt);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-05-29 21:20:32 +02:00
|
|
|
/* Next try out of process */
|
2002-01-18 19:09:37 +01:00
|
|
|
if (CLSCTX_LOCAL_SERVER & dwClsContext)
|
|
|
|
{
|
2006-02-23 20:02:00 +01:00
|
|
|
hres = RPC_GetLocalClassObject(rclsid,iid,ppv);
|
|
|
|
if (SUCCEEDED(hres))
|
|
|
|
return hres;
|
1998-11-01 17:51:10 +01:00
|
|
|
}
|
2002-01-18 19:09:37 +01:00
|
|
|
|
2004-07-06 23:27:48 +02:00
|
|
|
/* Finally try remote: this requires networked DCOM (a lot of work) */
|
2002-01-18 19:09:37 +01:00
|
|
|
if (CLSCTX_REMOTE_SERVER & dwClsContext)
|
|
|
|
{
|
|
|
|
FIXME ("CLSCTX_REMOTE_SERVER not supported\n");
|
2009-11-23 22:52:27 +01:00
|
|
|
hres = REGDB_E_CLASSNOTREG;
|
2002-01-18 19:09:37 +01:00
|
|
|
}
|
|
|
|
|
2005-11-12 20:11:21 +01:00
|
|
|
if (FAILED(hres))
|
2006-10-15 12:28:08 +02:00
|
|
|
ERR("no class object %s could be created for context 0x%x\n",
|
2005-11-12 20:11:21 +01:00
|
|
|
debugstr_guid(rclsid), dwClsContext);
|
Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c] [include/file.h]
Fixed SetFilePointer to allow negative positions as in DOS.
* [graphics/ddraw.c]
Added some methods to IDirect3D.
* [ole/compobj.c] [if1632/compobj.spec]
Added/implemented CoCreateStandardMalloc16,
CoGetClassObject, CoCreateInstance,
LookupETask, SetETask, CoGetState16.
* [loader/task.c]
MakeProcInstance: return 0 if func == NULL.
* [*/*] [tools/winapi-check]
Added zillions of missing WINAPI's and __cdecl's.
(oops, several caused by myself)
Wrote script for automated checking.
* [if1632/compobj.spec]
Many stub names.
* [misc/ddeml.c] [ole/compobj.c]
Some stubs.
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
Added preliminary tab control support.
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
More changes to the PostScript driver:
Implemented pens and solid brushes.
Colour/greyscale for fonts, pens and brushes.
To get coloured output you need to have *ColorDevice set to true
in your PPD, otherwise you'll get greyscale.
Landscape mode now works, as does non-A4 page sizes.
Encoding of fonts to ANSI is better, Symbol works again.
* [objects/dc.c] [include/gdi.h] [*/*]
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
belong.
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
[msdos/int2f.c] [msdos/interrupts.c]
Fixed portability. Adapted some code to make it easier to
integrate the DOS subsystem with the DPMI subsystem, made
the DPMI simulated real-mode interrupts be handled the V86
way. Added support for .COM files. Made int2f DPMI check
fail, to avoid pkunzip crashing in attempting to use DPMI.
Generally moved stuff around a little.
It is now technically possible to load several DOS programs
into the same memory space. Not tested, though.
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/kernel.spec]
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
* [win32/except.c]
Fixed one bad program behaviour, (deleting SEH while in
first walk). RtlUnwind is broken too I think (it should unwind
on success, not while walking the exception chain).
* [ole/ole2nls.c]
Get*DefaultLCID returns 0x400|id. expected by one application.
* [if1632/snoop.c]
Handle non-standard SP returns more graceful.
* [windows/class.c]
hinstances are mostly irrelevant for win32.
* [memory/string.c] [misc/registry.c]
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
for registry.c)
Some small speedup hacks for registry.c
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/comctl32/Makefile.in]
Created dlls/comctl32 and moved the common controls stuff to it.
* [misc/version.c]
Removed COMCTL32_DllGetVersion. The fixed function is part
of the common controls stuff.
* [dlls/comctl32/*.c][include/commctrl.h]
Added structure size tests.
* [dlls/comctl32/toolbar.c]
Fixed a bug in TOOLBAR_GetMaxWidth().
* [dlls/comctl32/animate.c][include/animate.h]
[dlls/comctl32/comboex.c][include/comboex.h]
[dlls/comctl32/hotkey.c][include/hotkey.h]
[dlls/comctl32/listview.c][include/listview.h]
[dlls/comctl32/commctrl.c][include/commctrl.h]
New files. Added Animation, ComboBoxEx, Hotkey and
Listview control dummies.
* [dlls/comctl32/tooltips.c]
Fixed a display bug and font selection.
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
Added missing DPA functions. Fixed bugs and published the
function prototypes.
* [documentation/common_controls]
Updated.
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
* [AUTHORS] [include/authors.h]
Added myself as a Wine author.
* [memory/virtual.c] [objects/dc.c]
Fixed runtime errors for Solaris.
* [misc/ddeml.c] [objects/gdiobj.c]
Minor fixes.
* [win32/device.c]
Added stubs for IFSMgr VxDCall and
a partial implementation of IFSMgr DeviceIo.
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
[relay32/msnet32.spec] [relay32/oledlg.spec]
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
Added news files for implementation of IMM32.DLL.
All functions return 0 as is correct for all Western Languages.
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
Added new files for implementation of OLEDLG.DLL.
Added stubs with FIXME:s for all functions.
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
[documentation/shell32][include/shell.h]
Clean up, bugfixes.
* [dlls/shell32/enumidlist.c]
Fileattributes implemented.
* [dlls/shell32/pidl.c]
Class pidlmgr splited into functions, structures changed,
some functions rewritten.
* [dlls/shell32/shell32_main.c]
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
* [dlls/shell32/shellord.c][relay32/shell32.spec]
Parameter documented, implemented SHCloneSpecialIDList.
Stub improved ShellExecuteEx32A.
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
SHGetDataFromIDListA, SHFileOperationA.
* [include/winnls.h][include/ole2nls.c]
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
in OLE_GetFormatA, GetTimeFormat32A.
* [win32/code_page.c]
WideCharToMultiByte: parameter checking and returning of strlen
implemented.
* [windows/keyboard.c][windows/defwnd.c]
Debug messages added.
* [windows/win.c]
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
* [controls/menu.c]
Missing line added.
* [include/winerror.h]
Macros for SUCCEEDED and FAILED added.
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [loader/module.c]
Bugfix: LoadModule16 should *not* call LoadModule32.
* [files/dos_fs.c]
Bugfix: don't crash if given directory doesn't exist.
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
Almost completed implementation of [snd]PlaySound (except
flags SND_ALIAS_ID and SND_APPLICATION).
* [if1632/user.spec][windows/winpos.c]
Added SetWindowRgn16 stub.
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
* [files/drive.c]
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
existent drive.
* [msdos/int21.c]
INT21_FindFirstFCB: check drive validity to prevent oops.
* [win32/file.c]
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [files/dos_fs.c]
Make DOSFS_OpenDir treat "" as "/".
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [windows/dialog.c]
GetNextDlgTabItem32: use last/first item instead of first/last
when hwndCtrl==0. This fixes initial focus.
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
* [include/process.h] [include/process.c]
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
with thread constant, and Win32 documentation (which calls it
a pseudohandle.) Made GetCurrentProcess actually use this
constant instead of the value.
* [include/process.h] [include/thread.h] [scheduler/thread.c]
[scheduler/process.c] [scheduler/handle.c]
Modify HANDLE_GetObjPtr to understand about
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
This allows DuplicateHandle to do the correct thing with these
handles. Removed now duplicate functionality from THREAD_GetPtr
and PROCESS_GetPtr.
* [loader/ne/segment.c]
Fixed two places where HFILE32s were being created and passed to
16-bit code. This should unbreak NE self-loading code.
Added two casts to remove compile time warnings.
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
* [msdos/dosmem.c] [msdos/int2f.c]
Added beginnings of DOS error table.
* [msdos/int1a.c]
Stub for subfunction 0xb0.
* [msdos/int10.c] [loader/dos/dosvm.c]
INT 10 support completely rewritten and lots of debugging
added. Now, DOS apps that use INT 10 to write to the screen will
work. (Beyond Zork does, at least. Somewhat.)
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
Another shot at getting MS's generic error message facility
right.
* [msdos/int21.c]
Command.Com wanted to set its own PSP address. I let it.
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
* [include/file.h] [misc/lzexpand.c]
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
convert lzw handles.
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/registry.c]
In RegEnumvalue, ivalue == 0 is a legal request and should
return the first entry.
* [msdos/int21.c]
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
* [windows/winproc.c]
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [windows/win.c]
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
flag when a child window is reparented to the desktop window.
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
* [controls/menu.c]
Menus created with SetMenuItemInfo and InsertMenuItem should
work now.
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
* [controls/combo.c]
Added CB_GETITEMHEIGHT.
* [windows/winpos.c]
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [include/windows.h]
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
GetPrivateProfileStructW, GetProfileSectionW,
WriteProfileSection[AW], WritePrivateProfileStructW.
1998-09-13 18:32:00 +02:00
|
|
|
return hres;
|
|
|
|
}
|
2005-08-15 11:46:51 +02:00
|
|
|
|
2000-04-06 21:33:36 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoResumeClassObjects (OLE32.@)
|
2000-02-14 20:56:21 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Resumes all class objects registered with REGCLS_SUSPENDED.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
2000-02-14 20:56:21 +01:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoResumeClassObjects(void)
|
|
|
|
{
|
2004-07-06 23:27:48 +02:00
|
|
|
FIXME("stub\n");
|
2000-02-14 20:56:21 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoCreateInstance [OLE32.@]
|
2006-12-07 01:52:40 +01:00
|
|
|
*
|
|
|
|
* Creates an instance of the specified class.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* rclsid [I] Class ID to create an instance of.
|
|
|
|
* pUnkOuter [I] Optional outer unknown to allow aggregation with another object.
|
|
|
|
* dwClsContext [I] Flags to restrict the location of the created instance.
|
|
|
|
* iid [I] The ID of the interface of the instance to return.
|
|
|
|
* ppv [O] On returns, contains a pointer to the specified interface of the instance.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* The dwClsContext parameter can be one or more of the following:
|
|
|
|
*| CLSCTX_INPROC_SERVER - Use an in-process server, such as from a DLL.
|
|
|
|
*| CLSCTX_INPROC_HANDLER - Use an in-process object which handles certain functions for an object running in another process.
|
|
|
|
*| CLSCTX_LOCAL_SERVER - Connect to an object running in another process.
|
|
|
|
*| CLSCTX_REMOTE_SERVER - Connect to an object running on another machine.
|
|
|
|
*
|
|
|
|
* Aggregation is the concept of deferring the IUnknown of an object to another
|
|
|
|
* object. This allows a separate object to behave as though it was part of
|
|
|
|
* the object and to allow this the pUnkOuter parameter can be set. Note that
|
|
|
|
* not all objects support having an outer of unknown.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoGetClassObject()
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
*/
|
2014-03-03 10:15:36 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(
|
2012-12-18 23:52:22 +01:00
|
|
|
REFCLSID rclsid,
|
|
|
|
LPUNKNOWN pUnkOuter,
|
|
|
|
DWORD dwClsContext,
|
|
|
|
REFIID iid,
|
|
|
|
LPVOID *ppv)
|
|
|
|
{
|
2015-10-21 16:24:48 +02:00
|
|
|
MULTI_QI multi_qi = { iid };
|
2012-12-18 23:52:22 +01:00
|
|
|
HRESULT hres;
|
Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c] [include/file.h]
Fixed SetFilePointer to allow negative positions as in DOS.
* [graphics/ddraw.c]
Added some methods to IDirect3D.
* [ole/compobj.c] [if1632/compobj.spec]
Added/implemented CoCreateStandardMalloc16,
CoGetClassObject, CoCreateInstance,
LookupETask, SetETask, CoGetState16.
* [loader/task.c]
MakeProcInstance: return 0 if func == NULL.
* [*/*] [tools/winapi-check]
Added zillions of missing WINAPI's and __cdecl's.
(oops, several caused by myself)
Wrote script for automated checking.
* [if1632/compobj.spec]
Many stub names.
* [misc/ddeml.c] [ole/compobj.c]
Some stubs.
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
Added preliminary tab control support.
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
More changes to the PostScript driver:
Implemented pens and solid brushes.
Colour/greyscale for fonts, pens and brushes.
To get coloured output you need to have *ColorDevice set to true
in your PPD, otherwise you'll get greyscale.
Landscape mode now works, as does non-A4 page sizes.
Encoding of fonts to ANSI is better, Symbol works again.
* [objects/dc.c] [include/gdi.h] [*/*]
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
belong.
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
[msdos/int2f.c] [msdos/interrupts.c]
Fixed portability. Adapted some code to make it easier to
integrate the DOS subsystem with the DPMI subsystem, made
the DPMI simulated real-mode interrupts be handled the V86
way. Added support for .COM files. Made int2f DPMI check
fail, to avoid pkunzip crashing in attempting to use DPMI.
Generally moved stuff around a little.
It is now technically possible to load several DOS programs
into the same memory space. Not tested, though.
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/kernel.spec]
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
* [win32/except.c]
Fixed one bad program behaviour, (deleting SEH while in
first walk). RtlUnwind is broken too I think (it should unwind
on success, not while walking the exception chain).
* [ole/ole2nls.c]
Get*DefaultLCID returns 0x400|id. expected by one application.
* [if1632/snoop.c]
Handle non-standard SP returns more graceful.
* [windows/class.c]
hinstances are mostly irrelevant for win32.
* [memory/string.c] [misc/registry.c]
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
for registry.c)
Some small speedup hacks for registry.c
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/comctl32/Makefile.in]
Created dlls/comctl32 and moved the common controls stuff to it.
* [misc/version.c]
Removed COMCTL32_DllGetVersion. The fixed function is part
of the common controls stuff.
* [dlls/comctl32/*.c][include/commctrl.h]
Added structure size tests.
* [dlls/comctl32/toolbar.c]
Fixed a bug in TOOLBAR_GetMaxWidth().
* [dlls/comctl32/animate.c][include/animate.h]
[dlls/comctl32/comboex.c][include/comboex.h]
[dlls/comctl32/hotkey.c][include/hotkey.h]
[dlls/comctl32/listview.c][include/listview.h]
[dlls/comctl32/commctrl.c][include/commctrl.h]
New files. Added Animation, ComboBoxEx, Hotkey and
Listview control dummies.
* [dlls/comctl32/tooltips.c]
Fixed a display bug and font selection.
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
Added missing DPA functions. Fixed bugs and published the
function prototypes.
* [documentation/common_controls]
Updated.
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
* [AUTHORS] [include/authors.h]
Added myself as a Wine author.
* [memory/virtual.c] [objects/dc.c]
Fixed runtime errors for Solaris.
* [misc/ddeml.c] [objects/gdiobj.c]
Minor fixes.
* [win32/device.c]
Added stubs for IFSMgr VxDCall and
a partial implementation of IFSMgr DeviceIo.
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
[relay32/msnet32.spec] [relay32/oledlg.spec]
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
Added news files for implementation of IMM32.DLL.
All functions return 0 as is correct for all Western Languages.
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
Added new files for implementation of OLEDLG.DLL.
Added stubs with FIXME:s for all functions.
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
[documentation/shell32][include/shell.h]
Clean up, bugfixes.
* [dlls/shell32/enumidlist.c]
Fileattributes implemented.
* [dlls/shell32/pidl.c]
Class pidlmgr splited into functions, structures changed,
some functions rewritten.
* [dlls/shell32/shell32_main.c]
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
* [dlls/shell32/shellord.c][relay32/shell32.spec]
Parameter documented, implemented SHCloneSpecialIDList.
Stub improved ShellExecuteEx32A.
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
SHGetDataFromIDListA, SHFileOperationA.
* [include/winnls.h][include/ole2nls.c]
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
in OLE_GetFormatA, GetTimeFormat32A.
* [win32/code_page.c]
WideCharToMultiByte: parameter checking and returning of strlen
implemented.
* [windows/keyboard.c][windows/defwnd.c]
Debug messages added.
* [windows/win.c]
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
* [controls/menu.c]
Missing line added.
* [include/winerror.h]
Macros for SUCCEEDED and FAILED added.
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [loader/module.c]
Bugfix: LoadModule16 should *not* call LoadModule32.
* [files/dos_fs.c]
Bugfix: don't crash if given directory doesn't exist.
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
Almost completed implementation of [snd]PlaySound (except
flags SND_ALIAS_ID and SND_APPLICATION).
* [if1632/user.spec][windows/winpos.c]
Added SetWindowRgn16 stub.
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
* [files/drive.c]
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
existent drive.
* [msdos/int21.c]
INT21_FindFirstFCB: check drive validity to prevent oops.
* [win32/file.c]
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [files/dos_fs.c]
Make DOSFS_OpenDir treat "" as "/".
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
* [windows/dialog.c]
GetNextDlgTabItem32: use last/first item instead of first/last
when hwndCtrl==0. This fixes initial focus.
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
* [include/process.h] [include/process.c]
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
with thread constant, and Win32 documentation (which calls it
a pseudohandle.) Made GetCurrentProcess actually use this
constant instead of the value.
* [include/process.h] [include/thread.h] [scheduler/thread.c]
[scheduler/process.c] [scheduler/handle.c]
Modify HANDLE_GetObjPtr to understand about
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
This allows DuplicateHandle to do the correct thing with these
handles. Removed now duplicate functionality from THREAD_GetPtr
and PROCESS_GetPtr.
* [loader/ne/segment.c]
Fixed two places where HFILE32s were being created and passed to
16-bit code. This should unbreak NE self-loading code.
Added two casts to remove compile time warnings.
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
* [msdos/dosmem.c] [msdos/int2f.c]
Added beginnings of DOS error table.
* [msdos/int1a.c]
Stub for subfunction 0xb0.
* [msdos/int10.c] [loader/dos/dosvm.c]
INT 10 support completely rewritten and lots of debugging
added. Now, DOS apps that use INT 10 to write to the screen will
work. (Beyond Zork does, at least. Somewhat.)
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
Another shot at getting MS's generic error message facility
right.
* [msdos/int21.c]
Command.Com wanted to set its own PSP address. I let it.
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
* [include/file.h] [misc/lzexpand.c]
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
convert lzw handles.
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/registry.c]
In RegEnumvalue, ivalue == 0 is a legal request and should
return the first entry.
* [msdos/int21.c]
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
* [windows/winproc.c]
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [windows/win.c]
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
flag when a child window is reparented to the desktop window.
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
* [controls/menu.c]
Menus created with SetMenuItemInfo and InsertMenuItem should
work now.
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
* [controls/combo.c]
Added CB_GETITEMHEIGHT.
* [windows/winpos.c]
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [include/windows.h]
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
GetPrivateProfileStructW, GetProfileSectionW,
WriteProfileSection[AW], WritePrivateProfileStructW.
1998-09-13 18:32:00 +02:00
|
|
|
|
2012-12-18 23:52:22 +01:00
|
|
|
TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid),
|
|
|
|
pUnkOuter, dwClsContext, debugstr_guid(iid), ppv);
|
2005-11-08 13:43:24 +01:00
|
|
|
|
2012-12-18 23:52:22 +01:00
|
|
|
if (ppv==0)
|
|
|
|
return E_POINTER;
|
1999-01-30 14:36:55 +01:00
|
|
|
|
2015-10-21 16:24:48 +02:00
|
|
|
hres = CoCreateInstanceEx(rclsid, pUnkOuter, dwClsContext, NULL, 1, &multi_qi);
|
|
|
|
*ppv = multi_qi.pItf;
|
2012-12-18 23:52:22 +01:00
|
|
|
return hres;
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
}
|
|
|
|
|
2016-03-20 19:07:40 +01:00
|
|
|
static void init_multi_qi(DWORD count, MULTI_QI *mqi, HRESULT hr)
|
2014-02-06 05:44:46 +01:00
|
|
|
{
|
|
|
|
ULONG i;
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
mqi[i].pItf = NULL;
|
2016-03-20 19:07:40 +01:00
|
|
|
mqi[i].hr = hr;
|
2014-02-06 05:44:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:22:37 +02:00
|
|
|
static HRESULT return_multi_qi(IUnknown *unk, DWORD count, MULTI_QI *mqi, BOOL include_unk)
|
2014-02-06 05:44:46 +01:00
|
|
|
{
|
2015-10-21 16:22:37 +02:00
|
|
|
ULONG index = 0, fetched = 0;
|
2014-02-06 05:44:46 +01:00
|
|
|
|
2015-10-21 16:22:37 +02:00
|
|
|
if (include_unk)
|
|
|
|
{
|
|
|
|
mqi[0].hr = S_OK;
|
|
|
|
mqi[0].pItf = unk;
|
|
|
|
index = fetched = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (; index < count; index++)
|
2014-02-06 05:44:46 +01:00
|
|
|
{
|
|
|
|
mqi[index].hr = IUnknown_QueryInterface(unk, mqi[index].pIID, (void**)&mqi[index].pItf);
|
|
|
|
if (mqi[index].hr == S_OK)
|
|
|
|
fetched++;
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:22:37 +02:00
|
|
|
if (!include_unk)
|
|
|
|
IUnknown_Release(unk);
|
2014-02-06 05:44:46 +01:00
|
|
|
|
|
|
|
if (fetched == 0)
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
|
|
|
return fetched == count ? S_OK : CO_S_NOTALLINTERFACES;
|
|
|
|
}
|
|
|
|
|
1999-04-11 14:01:08 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoCreateInstanceEx [OLE32.@]
|
1999-04-11 14:01:08 +02:00
|
|
|
*/
|
2013-12-20 01:16:29 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstanceEx(
|
2001-09-11 02:26:12 +02:00
|
|
|
REFCLSID rclsid,
|
1999-04-11 14:01:08 +02:00
|
|
|
LPUNKNOWN pUnkOuter,
|
2001-09-11 02:26:12 +02:00
|
|
|
DWORD dwClsContext,
|
1999-04-11 14:01:08 +02:00
|
|
|
COSERVERINFO* pServerInfo,
|
|
|
|
ULONG cmq,
|
|
|
|
MULTI_QI* pResults)
|
|
|
|
{
|
2015-10-21 16:24:48 +02:00
|
|
|
IUnknown *unk = NULL;
|
|
|
|
IClassFactory *cf;
|
|
|
|
APARTMENT *apt;
|
|
|
|
CLSID clsid;
|
|
|
|
HRESULT hres;
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2015-10-21 16:24:48 +02:00
|
|
|
TRACE("(%s %p %x %p %u %p)\n", debugstr_guid(rclsid), pUnkOuter, dwClsContext, pServerInfo, cmq, pResults);
|
1998-11-07 13:19:26 +01:00
|
|
|
|
2015-10-21 16:24:48 +02:00
|
|
|
if (!cmq || !pResults)
|
|
|
|
return E_INVALIDARG;
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2015-10-21 16:24:48 +02:00
|
|
|
if (pServerInfo)
|
|
|
|
FIXME("() non-NULL pServerInfo not supported!\n");
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2016-03-20 19:07:40 +01:00
|
|
|
init_multi_qi(cmq, pResults, E_NOINTERFACE);
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2015-10-21 16:24:48 +02:00
|
|
|
hres = CoGetTreatAsClass(rclsid, &clsid);
|
|
|
|
if(FAILED(hres))
|
|
|
|
clsid = *rclsid;
|
|
|
|
|
|
|
|
if (!(apt = COM_CurrentApt()))
|
|
|
|
{
|
|
|
|
if (!(apt = apartment_find_multi_threaded()))
|
|
|
|
{
|
|
|
|
ERR("apartment not initialised\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
apartment_release(apt);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Standard Global Interface Table (GIT) object is a process-wide singleton.
|
|
|
|
*/
|
|
|
|
if (IsEqualIID(&clsid, &CLSID_StdGlobalInterfaceTable))
|
|
|
|
{
|
|
|
|
IGlobalInterfaceTable *git = get_std_git();
|
|
|
|
TRACE("Retrieving GIT\n");
|
|
|
|
return return_multi_qi((IUnknown*)git, cmq, pResults, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsEqualCLSID(&clsid, &CLSID_ManualResetEvent)) {
|
|
|
|
hres = ManualResetEvent_Construct(pUnkOuter, pResults[0].pIID, (void**)&unk);
|
|
|
|
if (FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
return return_multi_qi(unk, cmq, pResults, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get a class factory to construct the object we want.
|
|
|
|
*/
|
|
|
|
hres = CoGetClassObject(&clsid, dwClsContext, NULL, &IID_IClassFactory, (void**)&cf);
|
|
|
|
if (FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create the object and don't forget to release the factory
|
|
|
|
*/
|
|
|
|
hres = IClassFactory_CreateInstance(cf, pUnkOuter, pResults[0].pIID, (void**)&unk);
|
|
|
|
IClassFactory_Release(cf);
|
|
|
|
if (FAILED(hres))
|
|
|
|
{
|
|
|
|
if (hres == CLASS_E_NOAGGREGATION && pUnkOuter)
|
|
|
|
FIXME("Class %s does not support aggregation\n", debugstr_guid(&clsid));
|
|
|
|
else
|
|
|
|
FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n",
|
|
|
|
debugstr_guid(pResults[0].pIID),
|
|
|
|
debugstr_guid(&clsid),hres);
|
|
|
|
return hres;
|
|
|
|
}
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2015-10-21 16:24:48 +02:00
|
|
|
return return_multi_qi(unk, cmq, pResults, TRUE);
|
2014-02-06 05:44:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoGetInstanceFromFile [OLE32.@]
|
|
|
|
*/
|
2015-11-12 15:58:07 +01:00
|
|
|
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetInstanceFromFile(
|
2014-02-06 05:44:46 +01:00
|
|
|
COSERVERINFO *server_info,
|
|
|
|
CLSID *rclsid,
|
|
|
|
IUnknown *outer,
|
|
|
|
DWORD cls_context,
|
|
|
|
DWORD grfmode,
|
|
|
|
OLECHAR *filename,
|
|
|
|
DWORD count,
|
|
|
|
MULTI_QI *results
|
|
|
|
)
|
|
|
|
{
|
|
|
|
IPersistFile *pf = NULL;
|
|
|
|
IUnknown* unk = NULL;
|
|
|
|
CLSID clsid;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (count == 0 || !results)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (server_info)
|
|
|
|
FIXME("() non-NULL server_info not supported\n");
|
|
|
|
|
2016-03-20 19:07:40 +01:00
|
|
|
init_multi_qi(count, results, E_NOINTERFACE);
|
2014-02-06 05:44:46 +01:00
|
|
|
|
2014-04-30 15:42:10 +02:00
|
|
|
/* optionally get CLSID from a file */
|
2014-02-06 05:44:46 +01:00
|
|
|
if (!rclsid)
|
1999-04-11 14:01:08 +02:00
|
|
|
{
|
2014-02-06 05:44:46 +01:00
|
|
|
hr = GetClassFile(filename, &clsid);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
ERR("failed to get CLSID from a file\n");
|
|
|
|
return hr;
|
|
|
|
}
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2014-02-06 05:44:46 +01:00
|
|
|
rclsid = &clsid;
|
1999-04-11 14:01:08 +02:00
|
|
|
}
|
|
|
|
|
2014-02-06 05:44:46 +01:00
|
|
|
hr = CoCreateInstance(rclsid,
|
|
|
|
outer,
|
|
|
|
cls_context,
|
|
|
|
&IID_IUnknown,
|
|
|
|
(void**)&unk);
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2014-02-06 05:44:46 +01:00
|
|
|
if (hr != S_OK)
|
2016-03-20 19:07:40 +01:00
|
|
|
{
|
|
|
|
init_multi_qi(count, results, hr);
|
|
|
|
return hr;
|
|
|
|
}
|
1999-04-11 14:01:08 +02:00
|
|
|
|
2014-02-06 05:44:46 +01:00
|
|
|
/* init from file */
|
|
|
|
hr = IUnknown_QueryInterface(unk, &IID_IPersistFile, (void**)&pf);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
2016-03-20 19:07:40 +01:00
|
|
|
init_multi_qi(count, results, hr);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
return hr;
|
2014-02-06 05:44:46 +01:00
|
|
|
}
|
|
|
|
|
2016-03-20 19:07:40 +01:00
|
|
|
hr = IPersistFile_Load(pf, filename, grfmode);
|
|
|
|
IPersistFile_Release(pf);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
return return_multi_qi(unk, count, results, FALSE);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
init_multi_qi(count, results, hr);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
return hr;
|
|
|
|
}
|
1999-04-11 14:01:08 +02:00
|
|
|
}
|
1998-11-07 13:19:26 +01:00
|
|
|
|
2014-02-07 05:55:13 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetInstanceFromIStorage [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetInstanceFromIStorage(
|
|
|
|
COSERVERINFO *server_info,
|
|
|
|
CLSID *rclsid,
|
|
|
|
IUnknown *outer,
|
|
|
|
DWORD cls_context,
|
|
|
|
IStorage *storage,
|
|
|
|
DWORD count,
|
|
|
|
MULTI_QI *results
|
|
|
|
)
|
|
|
|
{
|
|
|
|
IPersistStorage *ps = NULL;
|
|
|
|
IUnknown* unk = NULL;
|
|
|
|
STATSTG stat;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (count == 0 || !results || !storage)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (server_info)
|
|
|
|
FIXME("() non-NULL server_info not supported\n");
|
|
|
|
|
2016-03-20 19:07:40 +01:00
|
|
|
init_multi_qi(count, results, E_NOINTERFACE);
|
2014-02-07 05:55:13 +01:00
|
|
|
|
2014-04-30 15:42:10 +02:00
|
|
|
/* optionally get CLSID from a file */
|
2014-02-07 05:55:13 +01:00
|
|
|
if (!rclsid)
|
|
|
|
{
|
|
|
|
memset(&stat.clsid, 0, sizeof(stat.clsid));
|
|
|
|
hr = IStorage_Stat(storage, &stat, STATFLAG_NONAME);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
ERR("failed to get CLSID from a file\n");
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
rclsid = &stat.clsid;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = CoCreateInstance(rclsid,
|
|
|
|
outer,
|
|
|
|
cls_context,
|
|
|
|
&IID_IUnknown,
|
|
|
|
(void**)&unk);
|
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
/* init from IStorage */
|
|
|
|
hr = IUnknown_QueryInterface(unk, &IID_IPersistStorage, (void**)&ps);
|
|
|
|
if (FAILED(hr))
|
|
|
|
ERR("failed to get IPersistStorage\n");
|
|
|
|
|
|
|
|
if (ps)
|
|
|
|
{
|
|
|
|
IPersistStorage_Load(ps, storage);
|
|
|
|
IPersistStorage_Release(ps);
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:22:37 +02:00
|
|
|
return return_multi_qi(unk, count, results, FALSE);
|
2014-02-07 05:55:13 +01:00
|
|
|
}
|
|
|
|
|
1998-11-01 15:47:53 +01:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoLoadLibrary (OLE32.@)
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Loads a library.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpszLibName [I] Path to library.
|
|
|
|
* bAutoFree [I] Whether the library should automatically be freed.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: Handle to loaded library.
|
|
|
|
* Failure: NULL.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoFreeLibrary, CoFreeAllLibraries, CoFreeUnusedLibraries
|
1998-11-01 15:47:53 +01:00
|
|
|
*/
|
2002-08-03 02:17:10 +02:00
|
|
|
HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree)
|
1998-11-01 15:47:53 +01:00
|
|
|
{
|
2002-08-03 02:17:10 +02:00
|
|
|
TRACE("(%s, %d)\n", debugstr_w(lpszLibName), bAutoFree);
|
2001-09-11 02:26:12 +02:00
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
return LoadLibraryExW(lpszLibName, 0, LOAD_WITH_ALTERED_SEARCH_PATH);
|
|
|
|
}
|
1998-11-07 13:19:26 +01:00
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoFreeLibrary [OLE32.@]
|
2002-08-03 02:17:10 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Unloads a library from memory.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* hLibrary [I] Handle to library to unload.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoLoadLibrary, CoFreeAllLibraries, CoFreeUnusedLibraries
|
2002-08-03 02:17:10 +02:00
|
|
|
*/
|
|
|
|
void WINAPI CoFreeLibrary(HINSTANCE hLibrary)
|
|
|
|
{
|
2004-03-24 00:20:16 +01:00
|
|
|
FreeLibrary(hLibrary);
|
1998-11-07 13:19:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoFreeAllLibraries [OLE32.@]
|
2002-08-03 02:17:10 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Function for backwards compatibility only. Does nothing.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoLoadLibrary, CoFreeLibrary, CoFreeUnusedLibraries
|
1998-11-07 13:19:26 +01:00
|
|
|
*/
|
|
|
|
void WINAPI CoFreeAllLibraries(void)
|
|
|
|
{
|
2004-03-24 00:20:16 +01:00
|
|
|
/* NOP */
|
1998-11-01 15:47:53 +01:00
|
|
|
}
|
|
|
|
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
/***********************************************************************
|
2007-09-12 11:02:08 +02:00
|
|
|
* CoFreeUnusedLibrariesEx [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
2007-09-12 11:02:08 +02:00
|
|
|
* Frees any previously unused libraries whose delay has expired and marks
|
|
|
|
* currently unused libraries for unloading. Unused are identified as those that
|
|
|
|
* return S_OK from their DllCanUnloadNow function.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* dwUnloadDelay [I] Unload delay in milliseconds.
|
|
|
|
* dwReserved [I] Reserved. Set to 0.
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
2002-08-03 02:17:10 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* SEE ALSO
|
|
|
|
* CoLoadLibrary, CoFreeAllLibraries, CoFreeLibrary
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
*/
|
2013-12-20 01:16:29 +01:00
|
|
|
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibrariesEx(DWORD dwUnloadDelay, DWORD dwReserved)
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
{
|
2007-04-04 19:57:31 +02:00
|
|
|
struct apartment *apt = COM_CurrentApt();
|
|
|
|
if (!apt)
|
|
|
|
{
|
|
|
|
ERR("apartment not initialised\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-09-12 11:02:08 +02:00
|
|
|
apartment_freeunusedlibraries(apt, dwUnloadDelay);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoFreeUnusedLibraries [OLE32.@]
|
|
|
|
*
|
|
|
|
* Frees any unused libraries. Unused are identified as those that return
|
|
|
|
* S_OK from their DllCanUnloadNow function.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoLoadLibrary, CoFreeAllLibraries, CoFreeLibrary
|
|
|
|
*/
|
2013-12-20 01:16:29 +01:00
|
|
|
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void)
|
2007-09-12 11:02:08 +02:00
|
|
|
{
|
|
|
|
CoFreeUnusedLibrariesEx(INFINITE, 0);
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoFileTimeNow [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Retrieves the current time in FILETIME format.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpFileTime [O] The current time.
|
2001-07-11 20:56:41 +02:00
|
|
|
*
|
1998-03-29 21:44:57 +02:00
|
|
|
* RETURNS
|
2005-01-14 18:05:36 +01:00
|
|
|
* S_OK.
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
HRESULT WINAPI CoFileTimeNow( FILETIME *lpFileTime )
|
2000-08-14 16:42:41 +02:00
|
|
|
{
|
|
|
|
GetSystemTimeAsFileTime( lpFileTime );
|
|
|
|
return S_OK;
|
Release 980201
Sun Feb 1 13:24:54 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [files/drive.c]
Added Device= parameter to drive configuration.
* [if1632/relay.c]
Throw() and Catch() now use the correct CATCHBUF layout (untested).
* [tools/build.c] [include/stackframe.h] [loader/task.c]
Moved 16-bit stack pointer into thread database.
Save current %fs while running 16-bit code.
Fri Jan 30 09:25:49 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c]
Made DPtoLP32 and LPtoDP32 respect world transforms.
* [graphics/path.c] [graphics/painting.c] [if1632/gdi.spec]
[include/path.h]
More path support.
* [include/gdi.h] [include/windows.h] [objects/dc.c]
[relay/gdi32.spec]
Support for Get/SetArcDirection and Get/SetWorldTransform
* [windows/hook.c]
Fixed a bug in HOOK_Map16To32Common.
Thu Jan 29 23:43:18 1998 Douglas Ridgway <ridgway@taiga.gmcl.com>
* [graphics/metafiledrv/init.c] [objects/metafile.c]
Documentation for metafile related API calls. Fixed a bug to avoid
documenting it.
* [include/windows.h]
Declaration for LoadImage.
Thu Jan 29 21:44:45 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [graphics/win16drv/*]
Changes to printing code to enable use of printer fonts with the
win3.1 postscript driver. Remember to add printer=on to [wine]
section of wine.conf . You will also need to disable truetype
fonts from control panel. Winword 6.0 and Write seem to be happy
with this...
* [include/bitmap.h]
Fix Widthbytes for 15bpp displays.
Tue Jan 27 20:54:08 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [tsx11/*] [include/ts*] [tools/make_X11wrappers]
Implemented thread-safe X11 wrappers.
Tue Jan 27 13:54:09 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [windows/queue.c]
Forgot to convert thdb to thread_id.
* [misc/registry.c]
Sped up Windows 95 registry reading. Changed code to traverse
registry as a tree rather than read in all possible keys
(including dead ones).
Tue Jan 27 12:46:09 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][Makefile.in][scheduler/thread.c]
[libtest/hello5.c]
Don't exit() on failed to load referenced dlls.
Fixed static tls allocation for multiple threads.
WINELIB should now be able to load PE dlls. A sample
winelib program, that dynamically loads a internal dll
is included.
* [graphics/ddraw.c][include/ddraw.h][include/d3d.h]
Cleaned up and enhanced further. Added several DirectX5
interface definitions and DirectSurface3 implementation.
Stubs for D3D (NOT coming soon, just there so it fails safely).
* [multimedia/dsound.c][include/dsound.h]
Actually works now for a lot of cases. Some DirectX5 stuff
added. Still lacking several features.
* [windows/dinput.c][include/dinput.h]
Started implementing DirectInput. Doesn't work yet, don't
know why.
* [if1632/thunk.c][misc/callbacks.c]
[win32/kernel.c][include/callbacks.h]
Added WOWCallback16Ex, WOWHandle32.
* [misc/cpu.c]
Fixed GetSystemInfo, IsProcessorFeaturePresent.
* [multimedia/joystick.c][multimedia/time.c]
Several fixes. Small hack to get timerevents in timeGetTime() loops.
Tue Jan 20 11:26:27 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [configure.in]
Fixed check for union semun on FreeBSD systems.
Sun Jan 18 23:05:04 1998 Karl Backstrm <karl_b@geocities.com>
* [misc/ole2nls.c] [programs/progman/Sw.rc] [programs/winhelp/Sw.rc]
[resources/sysres_Sw.rc]
Added/updated Swedish language support.
Sun Jan 18 18:49:01 1998 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c] [misc/winsock_dns.c] [windows/event.c]
[windows/win.c] [windows/dce.c] [windows/winpos.c]
Bug fixes.
Sun Jan 18 12:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [msdos/int25.c] [msdos/int26.c]
Implemented "native" absolute disk read/write access.
* [msdos/int13.c] [msdos/ioports.c]
Enhanced GET DRIVE PARAMETERS (int13 AH=08).
* [graphics/win16drv/prtdrv.c] [if1632/gdi.spec]
Fixed typos, implemented dmEnumDFonts,
Started implementation of dmRealizeObject.
* [if1632/compobj.spec] [ole/compobj.c] [relay32/ole32.spec]
Stubs CoCreateInstance, CoFreeUnusedLibraries, implemented
CoFileTimeNow.
* [if1632/kernel.spec] [include/windows.h] [memory/global.c]
[memory/string.c] [misc/kernel.c] [misc/Makefile.in]
[misc/toolhelp.c] [msdos/int21.c]
Implemented GlobalHandleNoRIP, GetFreeMemInfo, DebugFillBuffer,
stubs GetSetKernelDOSProc, DiagQuery, DiagOutput, ToolHelpHook
(Undocumented Windows).
* [if1632/user.spec] [if1632/win32s16.spec] [misc/win32s16.c]
Misc stubs.
* [if1632/winaspi.spec] [misc/aspi.c]
Implemented GetASPIDLLVersion.
* [if1632/wprocs.spec] [msdos/int20.c] [msdos/Makefile.in]
Added handler for Int 0x20 (terminate program, _very_ old-fashioned).
* [misc/w32scomb.c]
Implemented Get16DLLAddress() partially
(big thanks to Marcus and Alexandre).
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/dplay.spec]
Added built-in DPLAY.DLL.
* [relay32/winmm.spec] [multimedia/joystick.c]
Added joySetThreshold.
* [misc/windebug.c]
Added WinNotify.
* [win32/console.c]
Stubs CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer,
WriteConsoleOutput32A.
* [windows/user.c]
Stub SetEventHook.
Sat Jan 17 19:30:35 1998 Matthew Toseland <Paul.Toseland@btinternet.com>
* [windows/painting.c]
Fixed broken restore-to-maximized.
Mon Jan 12 21:25:32 1998 Perceval - Marc Huguet Puig <mhp@tinet.fut.es>
* [documentation/wine.man] [include/options.h]
[misc/main.c] [ole/ole2nls.c] [resources/sysres.c]
[resources/sysres_Ca.rc] [resources/Makefile.in]
Added language catalan. (Afegit l'idioma catal).
1998-02-01 19:33:27 +01:00
|
|
|
}
|
Release 980301
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
1998-03-01 21:05:02 +01:00
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoLockObjectExternal [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Increments or decrements the external reference count of a stub object.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pUnk [I] Stub object.
|
|
|
|
* fLock [I] If TRUE then increments the external ref-count,
|
|
|
|
* otherwise decrements.
|
|
|
|
* fLastUnlockReleases [I] If TRUE then the last unlock has the effect of
|
|
|
|
* calling CoDisconnectObject.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
2006-06-30 12:07:43 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* If fLock is TRUE and an object is passed in that doesn't have a stub
|
|
|
|
* manager then a new stub manager is created for the object.
|
1999-02-13 09:59:48 +01:00
|
|
|
*/
|
2002-08-03 02:17:10 +02:00
|
|
|
HRESULT WINAPI CoLockObjectExternal(
|
2005-02-08 17:51:22 +01:00
|
|
|
LPUNKNOWN pUnk,
|
|
|
|
BOOL fLock,
|
|
|
|
BOOL fLastUnlockReleases)
|
1999-02-13 09:59:48 +01:00
|
|
|
{
|
2005-02-08 17:51:22 +01:00
|
|
|
struct stub_manager *stubmgr;
|
|
|
|
struct apartment *apt;
|
|
|
|
|
2004-12-27 20:21:47 +01:00
|
|
|
TRACE("pUnk=%p, fLock=%s, fLastUnlockReleases=%s\n",
|
|
|
|
pUnk, fLock ? "TRUE" : "FALSE", fLastUnlockReleases ? "TRUE" : "FALSE");
|
1999-02-13 09:59:48 +01:00
|
|
|
|
2005-02-08 17:51:22 +01:00
|
|
|
apt = COM_CurrentApt();
|
|
|
|
if (!apt) return CO_E_NOTINITIALIZED;
|
|
|
|
|
2015-08-28 14:58:55 +02:00
|
|
|
stubmgr = get_stub_manager_from_object(apt, pUnk, fLock);
|
|
|
|
if (!stubmgr)
|
2005-02-08 17:51:22 +01:00
|
|
|
{
|
|
|
|
WARN("stub object not found %p\n", pUnk);
|
|
|
|
/* Note: native is pretty broken here because it just silently
|
|
|
|
* fails, without returning an appropriate error code, making apps
|
|
|
|
* think that the object was disconnected, when it actually wasn't */
|
|
|
|
return S_OK;
|
|
|
|
}
|
2015-08-28 14:58:55 +02:00
|
|
|
|
|
|
|
if (fLock)
|
|
|
|
stub_manager_ext_addref(stubmgr, 1, FALSE);
|
|
|
|
else
|
|
|
|
stub_manager_ext_release(stubmgr, 1, FALSE, fLastUnlockReleases);
|
|
|
|
|
|
|
|
stub_manager_int_release(stubmgr);
|
|
|
|
return S_OK;
|
1999-02-13 09:59:48 +01:00
|
|
|
}
|
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoInitializeWOW (OLE32.@)
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* WOW equivalent of CoInitialize?
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* x [I] Unknown.
|
|
|
|
* y [I] Unknown.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Unknown.
|
1999-02-13 09:59:48 +01:00
|
|
|
*/
|
2005-01-14 18:05:36 +01:00
|
|
|
HRESULT WINAPI CoInitializeWOW(DWORD x,DWORD y)
|
|
|
|
{
|
2006-10-15 12:28:08 +02:00
|
|
|
FIXME("(0x%08x,0x%08x),stub!\n",x,y);
|
2002-08-03 02:17:10 +02:00
|
|
|
return 0;
|
1999-02-13 09:59:48 +01:00
|
|
|
}
|
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoGetState [OLE32.@]
|
2002-08-03 02:17:10 +02:00
|
|
|
*
|
2005-01-12 20:48:39 +01:00
|
|
|
* Retrieves the thread state object previously stored by CoSetState().
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* ppv [I] Address where pointer to object will be stored.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: E_OUTOFMEMORY.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Crashes on all invalid ppv addresses, including NULL.
|
|
|
|
* If the function returns a non-NULL object then the caller must release its
|
|
|
|
* reference on the object when the object is no longer required.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoSetState().
|
1999-02-13 09:59:48 +01:00
|
|
|
*/
|
2002-08-03 02:17:10 +02:00
|
|
|
HRESULT WINAPI CoGetState(IUnknown ** ppv)
|
1999-02-13 09:59:48 +01:00
|
|
|
{
|
2005-01-12 20:48:39 +01:00
|
|
|
struct oletls *info = COM_CurrentInfo();
|
|
|
|
if (!info) return E_OUTOFMEMORY;
|
2004-02-10 02:36:20 +01:00
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
*ppv = NULL;
|
2001-09-11 02:26:12 +02:00
|
|
|
|
2005-01-12 20:48:39 +01:00
|
|
|
if (info->state)
|
2005-01-05 18:14:33 +01:00
|
|
|
{
|
2005-01-12 20:48:39 +01:00
|
|
|
IUnknown_AddRef(info->state);
|
|
|
|
*ppv = info->state;
|
|
|
|
TRACE("apt->state=%p\n", info->state);
|
2005-01-05 18:14:33 +01:00
|
|
|
}
|
2001-09-11 02:26:12 +02:00
|
|
|
|
2005-01-12 20:48:39 +01:00
|
|
|
return S_OK;
|
1999-02-13 09:59:48 +01:00
|
|
|
}
|
1999-06-22 21:10:52 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoSetState [OLE32.@]
|
1999-06-22 21:10:52 +02:00
|
|
|
*
|
2005-01-12 20:48:39 +01:00
|
|
|
* Sets the thread state object.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pv [I] Pointer to state object to be stored.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* The system keeps a reference on the object while the object stored.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: E_OUTOFMEMORY.
|
1999-06-22 21:10:52 +02:00
|
|
|
*/
|
2002-08-03 02:17:10 +02:00
|
|
|
HRESULT WINAPI CoSetState(IUnknown * pv)
|
1999-06-22 21:10:52 +02:00
|
|
|
{
|
2005-01-12 20:48:39 +01:00
|
|
|
struct oletls *info = COM_CurrentInfo();
|
|
|
|
if (!info) return E_OUTOFMEMORY;
|
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
if (pv) IUnknown_AddRef(pv);
|
2004-02-10 02:36:20 +01:00
|
|
|
|
2005-01-12 20:48:39 +01:00
|
|
|
if (info->state)
|
2005-01-05 18:14:33 +01:00
|
|
|
{
|
2005-01-12 20:48:39 +01:00
|
|
|
TRACE("-- release %p now\n", info->state);
|
|
|
|
IUnknown_Release(info->state);
|
2005-01-05 18:14:33 +01:00
|
|
|
}
|
2002-08-03 02:17:10 +02:00
|
|
|
|
2005-01-12 20:48:39 +01:00
|
|
|
info->state = pv;
|
2002-08-03 02:17:10 +02:00
|
|
|
|
2005-01-05 18:14:33 +01:00
|
|
|
return S_OK;
|
1999-06-22 21:10:52 +02:00
|
|
|
}
|
2000-07-29 13:29:26 +02:00
|
|
|
|
2002-08-03 02:17:10 +02:00
|
|
|
|
2002-01-03 03:34:09 +01:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoTreatAsClass [OLE32.@]
|
2004-03-29 23:41:33 +02:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Sets the TreatAs value of a class.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* clsidOld [I] Class to set TreatAs value on.
|
|
|
|
* clsidNew [I] The class the clsidOld should be treated as.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoGetTreatAsClass
|
2002-01-03 03:34:09 +01:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
|
|
|
|
{
|
2005-06-20 15:14:22 +02:00
|
|
|
static const WCHAR wszAutoTreatAs[] = {'A','u','t','o','T','r','e','a','t','A','s',0};
|
|
|
|
static const WCHAR wszTreatAs[] = {'T','r','e','a','t','A','s',0};
|
|
|
|
HKEY hkey = NULL;
|
|
|
|
WCHAR szClsidNew[CHARS_IN_GUID];
|
2002-01-03 03:34:09 +01:00
|
|
|
HRESULT res = S_OK;
|
2005-06-20 15:14:22 +02:00
|
|
|
WCHAR auto_treat_as[CHARS_IN_GUID];
|
2004-03-29 23:41:33 +02:00
|
|
|
LONG auto_treat_as_size = sizeof(auto_treat_as);
|
|
|
|
CLSID id;
|
2002-01-03 03:34:09 +01:00
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
res = COM_OpenKeyForCLSID(clsidOld, NULL, KEY_READ | KEY_WRITE, &hkey);
|
|
|
|
if (FAILED(res))
|
|
|
|
goto done;
|
2014-06-13 20:00:46 +02:00
|
|
|
|
|
|
|
if (IsEqualGUID( clsidOld, clsidNew ))
|
2001-02-12 02:26:16 +01:00
|
|
|
{
|
2005-06-20 15:14:22 +02:00
|
|
|
if (!RegQueryValueW(hkey, wszAutoTreatAs, auto_treat_as, &auto_treat_as_size) &&
|
2008-08-17 19:30:59 +02:00
|
|
|
CLSIDFromString(auto_treat_as, &id) == S_OK)
|
2004-03-29 23:41:33 +02:00
|
|
|
{
|
2005-06-20 15:14:22 +02:00
|
|
|
if (RegSetValueW(hkey, wszTreatAs, REG_SZ, auto_treat_as, sizeof(auto_treat_as)))
|
2004-03-29 23:41:33 +02:00
|
|
|
{
|
|
|
|
res = REGDB_E_WRITEREGDB;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-06-13 20:00:46 +02:00
|
|
|
if(RegDeleteKeyW(hkey, wszTreatAs))
|
|
|
|
res = REGDB_E_WRITEREGDB;
|
2004-03-29 23:41:33 +02:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
2014-06-13 20:00:46 +02:00
|
|
|
else
|
2004-03-29 23:41:33 +02:00
|
|
|
{
|
2014-06-13 20:00:46 +02:00
|
|
|
if(IsEqualGUID(clsidNew, &CLSID_NULL)){
|
|
|
|
RegDeleteKeyW(hkey, wszTreatAs);
|
|
|
|
}else{
|
|
|
|
if(!StringFromGUID2(clsidNew, szClsidNew, ARRAYSIZE(szClsidNew))){
|
|
|
|
WARN("StringFromGUID2 failed\n");
|
|
|
|
res = E_FAIL;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(RegSetValueW(hkey, wszTreatAs, REG_SZ, szClsidNew, sizeof(szClsidNew)) != ERROR_SUCCESS){
|
|
|
|
WARN("RegSetValue failed\n");
|
|
|
|
res = REGDB_E_WRITEREGDB;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
}
|
2001-02-12 02:26:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
if (hkey) RegCloseKey(hkey);
|
|
|
|
return res;
|
2000-07-29 13:29:26 +02:00
|
|
|
}
|
2000-08-03 06:16:34 +02:00
|
|
|
|
2003-01-11 21:58:10 +01:00
|
|
|
/******************************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoGetTreatAsClass [OLE32.@]
|
2003-01-11 21:58:10 +01:00
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* Gets the TreatAs value of a class.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* clsidOld [I] Class to get the TreatAs value of.
|
|
|
|
* clsidNew [I] The class the clsidOld should be treated as.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoSetTreatAsClass
|
2003-01-11 21:58:10 +01:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID clsidNew)
|
|
|
|
{
|
2005-06-20 15:14:22 +02:00
|
|
|
static const WCHAR wszTreatAs[] = {'T','r','e','a','t','A','s',0};
|
|
|
|
HKEY hkey = NULL;
|
|
|
|
WCHAR szClsidNew[CHARS_IN_GUID];
|
2003-01-11 21:58:10 +01:00
|
|
|
HRESULT res = S_OK;
|
|
|
|
LONG len = sizeof(szClsidNew);
|
|
|
|
|
2010-03-15 20:51:56 +01:00
|
|
|
TRACE("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew);
|
2017-07-06 07:01:22 +02:00
|
|
|
|
|
|
|
if (!clsidOld || !clsidNew)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2008-03-10 22:58:39 +01:00
|
|
|
*clsidNew = *clsidOld; /* copy over old value */
|
2003-01-11 21:58:10 +01:00
|
|
|
|
2005-11-09 11:29:11 +01:00
|
|
|
res = COM_OpenKeyForCLSID(clsidOld, wszTreatAs, KEY_READ, &hkey);
|
|
|
|
if (FAILED(res))
|
2009-04-23 17:19:33 +02:00
|
|
|
{
|
|
|
|
res = S_FALSE;
|
2005-11-09 11:29:11 +01:00
|
|
|
goto done;
|
2009-04-23 17:19:33 +02:00
|
|
|
}
|
2005-11-09 11:29:11 +01:00
|
|
|
if (RegQueryValueW(hkey, NULL, szClsidNew, &len))
|
2003-01-11 21:58:10 +01:00
|
|
|
{
|
|
|
|
res = S_FALSE;
|
|
|
|
goto done;
|
|
|
|
}
|
2005-06-20 15:14:22 +02:00
|
|
|
res = CLSIDFromString(szClsidNew,clsidNew);
|
2003-01-11 21:58:10 +01:00
|
|
|
if (FAILED(res))
|
2006-10-15 12:28:08 +02:00
|
|
|
ERR("Failed CLSIDFromStringA(%s), hres 0x%08x\n", debugstr_w(szClsidNew), res);
|
2003-01-11 21:58:10 +01:00
|
|
|
done:
|
|
|
|
if (hkey) RegCloseKey(hkey);
|
|
|
|
return res;
|
|
|
|
}
|
2002-01-03 03:34:09 +01:00
|
|
|
|
2005-01-14 18:05:36 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* CoGetCurrentProcess [OLE32.@]
|
|
|
|
*
|
|
|
|
* Gets the current process ID.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* The current process ID.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Is DWORD really the correct return type for this function?
|
|
|
|
*/
|
|
|
|
DWORD WINAPI CoGetCurrentProcess(void)
|
|
|
|
{
|
|
|
|
return GetCurrentProcessId();
|
|
|
|
}
|
|
|
|
|
2016-03-10 10:51:33 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetCurrentLogicalThreadId [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetCurrentLogicalThreadId(GUID *id)
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n", id);
|
|
|
|
|
|
|
|
if (!id)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*id = COM_CurrentCausalityId();
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-01-14 18:05:36 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* CoRegisterMessageFilter [OLE32.@]
|
|
|
|
*
|
|
|
|
* Registers a message filter.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpMessageFilter [I] Pointer to interface.
|
|
|
|
* lplpMessageFilter [O] Indirect pointer to prior instance if non-NULL.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
2006-07-14 18:13:58 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Both lpMessageFilter and lplpMessageFilter are optional. Passing in a NULL
|
|
|
|
* lpMessageFilter removes the message filter.
|
|
|
|
*
|
|
|
|
* If lplpMessageFilter is not NULL the previous message filter will be
|
|
|
|
* returned in the memory pointer to this parameter and the caller is
|
|
|
|
* responsible for releasing the object.
|
|
|
|
*
|
|
|
|
* The current thread be in an apartment otherwise the function will crash.
|
2005-01-14 18:05:36 +01:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRegisterMessageFilter(
|
|
|
|
LPMESSAGEFILTER lpMessageFilter,
|
|
|
|
LPMESSAGEFILTER *lplpMessageFilter)
|
|
|
|
{
|
2006-07-14 18:13:58 +02:00
|
|
|
struct apartment *apt;
|
|
|
|
IMessageFilter *lpOldMessageFilter;
|
|
|
|
|
|
|
|
TRACE("(%p, %p)\n", lpMessageFilter, lplpMessageFilter);
|
|
|
|
|
|
|
|
apt = COM_CurrentApt();
|
|
|
|
|
|
|
|
/* can't set a message filter in a multi-threaded apartment */
|
2006-11-16 18:49:31 +01:00
|
|
|
if (!apt || apt->multi_threaded)
|
2006-07-14 18:13:58 +02:00
|
|
|
{
|
2006-11-16 18:49:31 +01:00
|
|
|
WARN("can't set message filter in MTA or uninitialized apt\n");
|
2006-07-14 18:13:58 +02:00
|
|
|
return CO_E_NOT_SUPPORTED;
|
2005-01-14 18:05:36 +01:00
|
|
|
}
|
2006-07-14 18:13:58 +02:00
|
|
|
|
|
|
|
if (lpMessageFilter)
|
|
|
|
IMessageFilter_AddRef(lpMessageFilter);
|
|
|
|
|
|
|
|
EnterCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
lpOldMessageFilter = apt->filter;
|
|
|
|
apt->filter = lpMessageFilter;
|
|
|
|
|
|
|
|
LeaveCriticalSection(&apt->cs);
|
|
|
|
|
|
|
|
if (lplpMessageFilter)
|
|
|
|
*lplpMessageFilter = lpOldMessageFilter;
|
|
|
|
else if (lpOldMessageFilter)
|
|
|
|
IMessageFilter_Release(lpOldMessageFilter);
|
|
|
|
|
2005-01-14 18:05:36 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoIsOle1Class [OLE32.@]
|
|
|
|
*
|
|
|
|
* Determines whether the specified class an OLE v1 class.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* clsid [I] Class to test.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE if the class is an OLE v1 class, or FALSE otherwise.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CoIsOle1Class(REFCLSID clsid)
|
|
|
|
{
|
|
|
|
FIXME("%s\n", debugstr_guid(clsid));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-08-03 06:16:34 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* IsEqualGUID [OLE32.@]
|
2000-08-03 06:16:34 +02:00
|
|
|
*
|
|
|
|
* Compares two Unique Identifiers.
|
|
|
|
*
|
2005-01-14 18:05:36 +01:00
|
|
|
* PARAMS
|
|
|
|
* rguid1 [I] The first GUID to compare.
|
|
|
|
* rguid2 [I] The other GUID to compare.
|
|
|
|
*
|
2000-08-03 06:16:34 +02:00
|
|
|
* RETURNS
|
|
|
|
* TRUE if equal
|
|
|
|
*/
|
|
|
|
#undef IsEqualGUID
|
|
|
|
BOOL WINAPI IsEqualGUID(
|
2005-01-14 18:05:36 +01:00
|
|
|
REFGUID rguid1,
|
|
|
|
REFGUID rguid2)
|
2000-08-03 06:16:34 +02:00
|
|
|
{
|
|
|
|
return !memcmp(rguid1,rguid2,sizeof(GUID));
|
|
|
|
}
|
2002-07-19 02:23:27 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2003-09-11 05:06:25 +02:00
|
|
|
* CoInitializeSecurity [OLE32.@]
|
2002-07-19 02:23:27 +02:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc,
|
|
|
|
SOLE_AUTHENTICATION_SERVICE* asAuthSvc,
|
|
|
|
void* pReserved1, DWORD dwAuthnLevel,
|
|
|
|
DWORD dwImpLevel, void* pReserved2,
|
|
|
|
DWORD dwCapabilities, void* pReserved3)
|
|
|
|
{
|
2006-10-15 12:28:08 +02:00
|
|
|
FIXME("(%p,%d,%p,%p,%d,%d,%p,%d,%p) - stub!\n", pSecDesc, cAuthSvc,
|
2002-07-19 02:23:27 +02:00
|
|
|
asAuthSvc, pReserved1, dwAuthnLevel, dwImpLevel, pReserved2,
|
|
|
|
dwCapabilities, pReserved3);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2004-09-20 23:44:34 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoSuspendClassObjects [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Suspends all registered class objects to prevent further requests coming in
|
|
|
|
* for those objects.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
2004-09-20 23:44:34 +02:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoSuspendClassObjects(void)
|
|
|
|
{
|
|
|
|
FIXME("\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
2004-12-01 16:33:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoAddRefServerProcess [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Helper function for incrementing the reference count of a local-server
|
|
|
|
* process.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* New reference count.
|
2007-03-09 19:55:13 +01:00
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoReleaseServerProcess().
|
2004-12-01 16:33:34 +01:00
|
|
|
*/
|
|
|
|
ULONG WINAPI CoAddRefServerProcess(void)
|
|
|
|
{
|
2007-03-09 19:55:13 +01:00
|
|
|
ULONG refs;
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
|
|
|
EnterCriticalSection(&csRegisteredClassList);
|
|
|
|
refs = ++s_COMServerProcessReferences;
|
|
|
|
LeaveCriticalSection(&csRegisteredClassList);
|
|
|
|
|
|
|
|
TRACE("refs before: %d\n", refs - 1);
|
|
|
|
|
|
|
|
return refs;
|
2004-12-01 16:33:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoReleaseServerProcess [OLE32.@]
|
2005-01-14 18:05:36 +01:00
|
|
|
*
|
|
|
|
* Helper function for decrementing the reference count of a local-server
|
|
|
|
* process.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* New reference count.
|
2007-03-09 19:55:13 +01:00
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* When reference count reaches 0, this function suspends all registered
|
|
|
|
* classes so no new connections are accepted.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoAddRefServerProcess(), CoSuspendClassObjects().
|
2004-12-01 16:33:34 +01:00
|
|
|
*/
|
|
|
|
ULONG WINAPI CoReleaseServerProcess(void)
|
|
|
|
{
|
2007-03-09 19:55:13 +01:00
|
|
|
ULONG refs;
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
|
|
|
EnterCriticalSection(&csRegisteredClassList);
|
|
|
|
|
|
|
|
refs = --s_COMServerProcessReferences;
|
|
|
|
/* FIXME: if (!refs) COM_SuspendClassObjects(); */
|
|
|
|
|
|
|
|
LeaveCriticalSection(&csRegisteredClassList);
|
|
|
|
|
|
|
|
TRACE("refs after: %d\n", refs);
|
|
|
|
|
|
|
|
return refs;
|
2004-12-01 16:33:34 +01:00
|
|
|
}
|
2005-01-28 12:27:46 +01:00
|
|
|
|
2005-05-11 14:57:16 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CoIsHandlerConnected [OLE32.@]
|
|
|
|
*
|
|
|
|
* Determines whether a proxy is connected to a remote stub.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pUnk [I] Pointer to object that may or may not be connected.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE if pUnk is not a proxy or if pUnk is connected to a remote stub, or
|
|
|
|
* FALSE otherwise.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CoIsHandlerConnected(IUnknown *pUnk)
|
|
|
|
{
|
|
|
|
FIXME("%p\n", pUnk);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2005-08-26 10:47:09 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoAllowSetForegroundWindow [OLE32.@]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, void *pvReserved)
|
|
|
|
{
|
|
|
|
FIXME("(%p, %p): stub\n", pUnk, pvReserved);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2005-05-11 14:57:16 +02:00
|
|
|
|
2005-01-28 12:27:46 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoQueryProxyBlanket [OLE32.@]
|
|
|
|
*
|
|
|
|
* Retrieves the security settings being used by a proxy.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pProxy [I] Pointer to the proxy object.
|
|
|
|
* pAuthnSvc [O] The type of authentication service.
|
|
|
|
* pAuthzSvc [O] The type of authorization service.
|
|
|
|
* ppServerPrincName [O] Optional. The server prinicple name.
|
|
|
|
* pAuthnLevel [O] The authentication level.
|
|
|
|
* pImpLevel [O] The impersonation level.
|
|
|
|
* ppAuthInfo [O] Information specific to the authorization/authentication service.
|
|
|
|
* pCapabilities [O] Flags affecting the security behaviour.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoCopyProxy, CoSetProxyBlanket.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoQueryProxyBlanket(IUnknown *pProxy, DWORD *pAuthnSvc,
|
|
|
|
DWORD *pAuthzSvc, OLECHAR **ppServerPrincName, DWORD *pAuthnLevel,
|
|
|
|
DWORD *pImpLevel, void **ppAuthInfo, DWORD *pCapabilities)
|
|
|
|
{
|
|
|
|
IClientSecurity *pCliSec;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("%p\n", pProxy);
|
|
|
|
|
|
|
|
hr = IUnknown_QueryInterface(pProxy, &IID_IClientSecurity, (void **)&pCliSec);
|
|
|
|
if (SUCCEEDED(hr))
|
2005-01-28 18:19:51 +01:00
|
|
|
{
|
2005-01-28 12:27:46 +01:00
|
|
|
hr = IClientSecurity_QueryBlanket(pCliSec, pProxy, pAuthnSvc,
|
|
|
|
pAuthzSvc, ppServerPrincName,
|
|
|
|
pAuthnLevel, pImpLevel, ppAuthInfo,
|
|
|
|
pCapabilities);
|
2005-01-28 18:19:51 +01:00
|
|
|
IClientSecurity_Release(pCliSec);
|
|
|
|
}
|
2005-01-28 12:27:46 +01:00
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
if (FAILED(hr)) ERR("-- failed with 0x%08x\n", hr);
|
2005-01-28 12:27:46 +01:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoSetProxyBlanket [OLE32.@]
|
|
|
|
*
|
|
|
|
* Sets the security settings for a proxy.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pProxy [I] Pointer to the proxy object.
|
|
|
|
* AuthnSvc [I] The type of authentication service.
|
|
|
|
* AuthzSvc [I] The type of authorization service.
|
|
|
|
* pServerPrincName [I] The server prinicple name.
|
|
|
|
* AuthnLevel [I] The authentication level.
|
|
|
|
* ImpLevel [I] The impersonation level.
|
|
|
|
* pAuthInfo [I] Information specific to the authorization/authentication service.
|
|
|
|
* Capabilities [I] Flags affecting the security behaviour.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoQueryProxyBlanket, CoCopyProxy.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoSetProxyBlanket(IUnknown *pProxy, DWORD AuthnSvc,
|
|
|
|
DWORD AuthzSvc, OLECHAR *pServerPrincName, DWORD AuthnLevel,
|
|
|
|
DWORD ImpLevel, void *pAuthInfo, DWORD Capabilities)
|
|
|
|
{
|
|
|
|
IClientSecurity *pCliSec;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("%p\n", pProxy);
|
|
|
|
|
|
|
|
hr = IUnknown_QueryInterface(pProxy, &IID_IClientSecurity, (void **)&pCliSec);
|
|
|
|
if (SUCCEEDED(hr))
|
2005-01-28 18:19:51 +01:00
|
|
|
{
|
2005-01-28 12:27:46 +01:00
|
|
|
hr = IClientSecurity_SetBlanket(pCliSec, pProxy, AuthnSvc,
|
|
|
|
AuthzSvc, pServerPrincName,
|
|
|
|
AuthnLevel, ImpLevel, pAuthInfo,
|
|
|
|
Capabilities);
|
2005-01-28 18:19:51 +01:00
|
|
|
IClientSecurity_Release(pCliSec);
|
|
|
|
}
|
2005-01-28 12:27:46 +01:00
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
if (FAILED(hr)) ERR("-- failed with 0x%08x\n", hr);
|
2005-01-28 12:27:46 +01:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoCopyProxy [OLE32.@]
|
|
|
|
*
|
|
|
|
* Copies a proxy.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pProxy [I] Pointer to the proxy object.
|
|
|
|
* ppCopy [O] Copy of the proxy.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoQueryProxyBlanket, CoSetProxyBlanket.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoCopyProxy(IUnknown *pProxy, IUnknown **ppCopy)
|
|
|
|
{
|
|
|
|
IClientSecurity *pCliSec;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("%p\n", pProxy);
|
|
|
|
|
|
|
|
hr = IUnknown_QueryInterface(pProxy, &IID_IClientSecurity, (void **)&pCliSec);
|
|
|
|
if (SUCCEEDED(hr))
|
2005-01-28 18:19:51 +01:00
|
|
|
{
|
2005-01-28 12:27:46 +01:00
|
|
|
hr = IClientSecurity_CopyProxy(pCliSec, pProxy, ppCopy);
|
2005-01-28 18:19:51 +01:00
|
|
|
IClientSecurity_Release(pCliSec);
|
|
|
|
}
|
2005-01-28 12:27:46 +01:00
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
if (FAILED(hr)) ERR("-- failed with 0x%08x\n", hr);
|
2005-01-28 12:27:46 +01:00
|
|
|
return hr;
|
|
|
|
}
|
2005-03-17 11:26:20 +01:00
|
|
|
|
|
|
|
|
2006-06-09 18:24:39 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetCallContext [OLE32.@]
|
|
|
|
*
|
|
|
|
* Gets the context of the currently executing server call in the current
|
|
|
|
* thread.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* riid [I] Context interface to return.
|
|
|
|
* ppv [O] Pointer to memory that will receive the context on return.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetCallContext(REFIID riid, void **ppv)
|
|
|
|
{
|
2009-01-18 15:17:45 +01:00
|
|
|
struct oletls *info = COM_CurrentInfo();
|
2006-06-09 18:24:39 +02:00
|
|
|
|
2009-01-18 15:17:45 +01:00
|
|
|
TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if (!info)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
if (!info->call_state)
|
|
|
|
return RPC_E_CALL_COMPLETE;
|
|
|
|
|
|
|
|
return IUnknown_QueryInterface(info->call_state, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoSwitchCallContext [OLE32.@]
|
|
|
|
*
|
|
|
|
* Switches the context of the currently executing server call in the current
|
|
|
|
* thread.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pObject [I] Pointer to new context object
|
|
|
|
* ppOldObject [O] Pointer to memory that will receive old context object pointer
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoSwitchCallContext(IUnknown *pObject, IUnknown **ppOldObject)
|
|
|
|
{
|
|
|
|
struct oletls *info = COM_CurrentInfo();
|
|
|
|
|
|
|
|
TRACE("(%p, %p)\n", pObject, ppOldObject);
|
|
|
|
|
|
|
|
if (!info)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
*ppOldObject = info->call_state;
|
|
|
|
info->call_state = pObject; /* CoSwitchCallContext does not addref nor release objects */
|
|
|
|
|
|
|
|
return S_OK;
|
2006-06-09 18:24:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoQueryClientBlanket [OLE32.@]
|
|
|
|
*
|
|
|
|
* Retrieves the authentication information about the client of the currently
|
|
|
|
* executing server call in the current thread.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pAuthnSvc [O] Optional. The type of authentication service.
|
|
|
|
* pAuthzSvc [O] Optional. The type of authorization service.
|
|
|
|
* pServerPrincName [O] Optional. The server prinicple name.
|
|
|
|
* pAuthnLevel [O] Optional. The authentication level.
|
|
|
|
* pImpLevel [O] Optional. The impersonation level.
|
|
|
|
* pPrivs [O] Optional. Information about the privileges of the client.
|
|
|
|
* pCapabilities [IO] Optional. Flags affecting the security behaviour.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoImpersonateClient, CoRevertToSelf, CoGetCallContext.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoQueryClientBlanket(
|
|
|
|
DWORD *pAuthnSvc,
|
|
|
|
DWORD *pAuthzSvc,
|
|
|
|
OLECHAR **pServerPrincName,
|
|
|
|
DWORD *pAuthnLevel,
|
|
|
|
DWORD *pImpLevel,
|
|
|
|
RPC_AUTHZ_HANDLE *pPrivs,
|
|
|
|
DWORD *pCapabilities)
|
|
|
|
{
|
|
|
|
IServerSecurity *pSrvSec;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p, %p, %p, %p, %p, %p, %p)\n",
|
|
|
|
pAuthnSvc, pAuthzSvc, pServerPrincName, pAuthnLevel, pImpLevel,
|
|
|
|
pPrivs, pCapabilities);
|
|
|
|
|
|
|
|
hr = CoGetCallContext(&IID_IServerSecurity, (void **)&pSrvSec);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = IServerSecurity_QueryBlanket(
|
|
|
|
pSrvSec, pAuthnSvc, pAuthzSvc, pServerPrincName, pAuthnLevel,
|
|
|
|
pImpLevel, pPrivs, pCapabilities);
|
|
|
|
IServerSecurity_Release(pSrvSec);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoImpersonateClient [OLE32.@]
|
|
|
|
*
|
|
|
|
* Impersonates the client of the currently executing server call in the
|
|
|
|
* current thread.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* None.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* If this function fails then the current thread will not be impersonating
|
|
|
|
* the client and all actions will take place on behalf of the server.
|
|
|
|
* Therefore, it is important to check the return value from this function.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoRevertToSelf, CoQueryClientBlanket, CoGetCallContext.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoImpersonateClient(void)
|
|
|
|
{
|
|
|
|
IServerSecurity *pSrvSec;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
|
|
|
hr = CoGetCallContext(&IID_IServerSecurity, (void **)&pSrvSec);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = IServerSecurity_ImpersonateClient(pSrvSec);
|
|
|
|
IServerSecurity_Release(pSrvSec);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoRevertToSelf [OLE32.@]
|
|
|
|
*
|
|
|
|
* Ends the impersonation of the client of the currently executing server
|
|
|
|
* call in the current thread.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* None.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* CoImpersonateClient, CoQueryClientBlanket, CoGetCallContext.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRevertToSelf(void)
|
|
|
|
{
|
|
|
|
IServerSecurity *pSrvSec;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
|
|
|
hr = CoGetCallContext(&IID_IServerSecurity, (void **)&pSrvSec);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = IServerSecurity_RevertToSelf(pSrvSec);
|
|
|
|
IServerSecurity_Release(pSrvSec);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2006-03-29 19:39:03 +02:00
|
|
|
static BOOL COM_PeekMessage(struct apartment *apt, MSG *msg)
|
|
|
|
{
|
2006-03-29 19:40:07 +02:00
|
|
|
/* first try to retrieve messages for incoming COM calls to the apartment window */
|
2015-07-30 17:02:51 +02:00
|
|
|
return (apt->win && PeekMessageW(msg, apt->win, 0, 0, PM_REMOVE|PM_NOYIELD)) ||
|
2006-03-29 19:40:46 +02:00
|
|
|
/* next retrieve other messages necessary for the app to remain responsive */
|
2009-05-15 20:35:25 +02:00
|
|
|
PeekMessageW(msg, NULL, WM_DDE_FIRST, WM_DDE_LAST, PM_REMOVE|PM_NOYIELD) ||
|
|
|
|
PeekMessageW(msg, NULL, 0, 0, PM_QS_PAINT|PM_QS_SENDMESSAGE|PM_REMOVE|PM_NOYIELD);
|
2006-03-29 19:39:03 +02:00
|
|
|
}
|
|
|
|
|
2005-03-17 11:26:20 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoWaitForMultipleHandles [OLE32.@]
|
|
|
|
*
|
|
|
|
* Waits for one or more handles to become signaled.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* dwFlags [I] Flags. See notes.
|
|
|
|
* dwTimeout [I] Timeout in milliseconds.
|
|
|
|
* cHandles [I] Number of handles pointed to by pHandles.
|
|
|
|
* pHandles [I] Handles to wait for.
|
|
|
|
* lpdwindex [O] Index of handle that was signaled.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: RPC_S_CALLPENDING on timeout.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
*
|
|
|
|
* The dwFlags parameter can be zero or more of the following:
|
|
|
|
*| COWAIT_WAITALL - Wait for all of the handles to become signaled.
|
|
|
|
*| COWAIT_ALERTABLE - Allows a queued APC to run during the wait.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* MsgWaitForMultipleObjects, WaitForMultipleObjects.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
|
2007-02-20 15:45:28 +01:00
|
|
|
ULONG cHandles, LPHANDLE pHandles, LPDWORD lpdwindex)
|
2005-03-17 11:26:20 +01:00
|
|
|
{
|
|
|
|
HRESULT hr = S_OK;
|
|
|
|
DWORD start_time = GetTickCount();
|
2006-03-29 19:38:42 +02:00
|
|
|
APARTMENT *apt = COM_CurrentApt();
|
|
|
|
BOOL message_loop = apt && !apt->multi_threaded;
|
2014-11-05 00:49:59 +01:00
|
|
|
BOOL check_apc = (dwFlags & COWAIT_ALERTABLE) != 0;
|
2018-01-22 17:05:34 +01:00
|
|
|
BOOL post_quit = FALSE;
|
|
|
|
UINT exit_code;
|
2005-03-17 11:26:20 +01:00
|
|
|
|
2006-10-15 12:28:08 +02:00
|
|
|
TRACE("(0x%08x, 0x%08x, %d, %p, %p)\n", dwFlags, dwTimeout, cHandles,
|
2005-03-17 11:26:20 +01:00
|
|
|
pHandles, lpdwindex);
|
|
|
|
|
2014-11-05 00:39:51 +01:00
|
|
|
if (!lpdwindex)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*lpdwindex = 0;
|
|
|
|
|
|
|
|
if (!pHandles)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (!cHandles)
|
|
|
|
return RPC_E_NO_SYNC;
|
|
|
|
|
2005-03-17 11:26:20 +01:00
|
|
|
while (TRUE)
|
|
|
|
{
|
|
|
|
DWORD now = GetTickCount();
|
|
|
|
DWORD res;
|
2006-01-20 16:14:23 +01:00
|
|
|
|
2007-12-24 11:23:06 +01:00
|
|
|
if (now - start_time > dwTimeout)
|
2005-03-17 11:26:20 +01:00
|
|
|
{
|
|
|
|
hr = RPC_S_CALLPENDING;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-01-20 16:14:23 +01:00
|
|
|
if (message_loop)
|
|
|
|
{
|
2008-02-13 13:35:08 +01:00
|
|
|
DWORD wait_flags = ((dwFlags & COWAIT_WAITALL) ? MWMO_WAITALL : 0) |
|
|
|
|
((dwFlags & COWAIT_ALERTABLE ) ? MWMO_ALERTABLE : 0);
|
2006-01-20 16:14:23 +01:00
|
|
|
|
|
|
|
TRACE("waiting for rpc completion or window message\n");
|
2005-03-17 11:26:20 +01:00
|
|
|
|
2014-11-05 00:49:59 +01:00
|
|
|
res = WAIT_TIMEOUT;
|
|
|
|
|
|
|
|
if (check_apc)
|
|
|
|
{
|
|
|
|
res = WaitForMultipleObjectsEx(cHandles, pHandles,
|
|
|
|
(dwFlags & COWAIT_WAITALL) != 0, 0, TRUE);
|
|
|
|
check_apc = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (res == WAIT_TIMEOUT)
|
|
|
|
res = MsgWaitForMultipleObjectsEx(cHandles, pHandles,
|
|
|
|
(dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now,
|
|
|
|
QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags);
|
2005-03-17 11:26:20 +01:00
|
|
|
|
2006-01-20 16:14:23 +01:00
|
|
|
if (res == WAIT_OBJECT_0 + cHandles) /* messages available */
|
2005-03-17 11:26:20 +01:00
|
|
|
{
|
2006-01-20 16:14:23 +01:00
|
|
|
MSG msg;
|
2012-12-12 14:06:46 +01:00
|
|
|
int count = 0;
|
2006-07-13 14:07:13 +02:00
|
|
|
|
2006-12-23 16:50:07 +01:00
|
|
|
/* call message filter */
|
|
|
|
|
|
|
|
if (COM_CurrentApt()->filter)
|
|
|
|
{
|
2006-12-23 16:51:27 +01:00
|
|
|
PENDINGTYPE pendingtype =
|
|
|
|
COM_CurrentInfo()->pending_call_count_server ?
|
|
|
|
PENDINGTYPE_NESTED : PENDINGTYPE_TOPLEVEL;
|
2006-12-23 16:50:07 +01:00
|
|
|
DWORD be_handled = IMessageFilter_MessagePending(
|
|
|
|
COM_CurrentApt()->filter, 0 /* FIXME */,
|
2006-12-23 16:51:27 +01:00
|
|
|
now - start_time, pendingtype);
|
2006-12-23 16:50:07 +01:00
|
|
|
TRACE("IMessageFilter_MessagePending returned %d\n", be_handled);
|
|
|
|
switch (be_handled)
|
|
|
|
{
|
|
|
|
case PENDINGMSG_CANCELCALL:
|
|
|
|
WARN("call canceled\n");
|
|
|
|
hr = RPC_E_CALL_CANCELED;
|
|
|
|
break;
|
|
|
|
case PENDINGMSG_WAITNOPROCESS:
|
|
|
|
case PENDINGMSG_WAITDEFPROCESS:
|
|
|
|
default:
|
|
|
|
/* FIXME: MSDN is very vague about the difference
|
|
|
|
* between WAITNOPROCESS and WAITDEFPROCESS - there
|
|
|
|
* appears to be none, so it is possibly a left-over
|
|
|
|
* from the 16-bit world. */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-19 07:17:06 +01:00
|
|
|
if (!apt->win)
|
|
|
|
{
|
|
|
|
/* If window is NULL on apartment, peek at messages so that it will not trigger
|
|
|
|
* MsgWaitForMultipleObjects next time. */
|
|
|
|
PeekMessageW(NULL, NULL, 0, 0, PM_QS_POSTMESSAGE | PM_NOREMOVE | PM_NOYIELD);
|
|
|
|
}
|
2012-12-12 14:06:46 +01:00
|
|
|
/* some apps (e.g. Visio 2010) don't handle WM_PAINT properly and loop forever,
|
|
|
|
* so after processing 100 messages we go back to checking the wait handles */
|
|
|
|
while (count++ < 100 && COM_PeekMessage(apt, &msg))
|
2005-10-03 13:02:37 +02:00
|
|
|
{
|
2006-01-20 16:14:23 +01:00
|
|
|
if (msg.message == WM_QUIT)
|
|
|
|
{
|
2018-01-22 17:05:40 +01:00
|
|
|
TRACE("received WM_QUIT message\n");
|
2018-01-22 17:05:34 +01:00
|
|
|
post_quit = TRUE;
|
|
|
|
exit_code = msg.wParam;
|
2006-01-20 16:14:23 +01:00
|
|
|
}
|
2018-01-22 17:05:40 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message);
|
|
|
|
TranslateMessage(&msg);
|
|
|
|
DispatchMessageW(&msg);
|
|
|
|
}
|
2005-10-03 13:02:37 +02:00
|
|
|
}
|
2006-01-20 16:14:23 +01:00
|
|
|
continue;
|
2005-03-17 11:26:20 +01:00
|
|
|
}
|
|
|
|
}
|
2006-01-20 16:14:23 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE("waiting for rpc completion\n");
|
|
|
|
|
2012-08-08 10:13:54 +02:00
|
|
|
res = WaitForMultipleObjectsEx(cHandles, pHandles, (dwFlags & COWAIT_WAITALL) != 0,
|
2006-01-20 16:14:23 +01:00
|
|
|
(dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now,
|
2012-08-08 10:13:54 +02:00
|
|
|
(dwFlags & COWAIT_ALERTABLE) != 0);
|
2006-01-20 16:14:23 +01:00
|
|
|
}
|
|
|
|
|
2011-01-21 14:51:37 +01:00
|
|
|
switch (res)
|
2005-03-17 11:26:20 +01:00
|
|
|
{
|
2011-01-21 14:51:37 +01:00
|
|
|
case WAIT_TIMEOUT:
|
2005-03-17 11:26:20 +01:00
|
|
|
hr = RPC_S_CALLPENDING;
|
|
|
|
break;
|
2011-01-21 14:51:37 +01:00
|
|
|
case WAIT_FAILED:
|
|
|
|
hr = HRESULT_FROM_WIN32( GetLastError() );
|
2011-01-21 14:17:22 +01:00
|
|
|
break;
|
2011-01-21 14:51:37 +01:00
|
|
|
default:
|
|
|
|
*lpdwindex = res;
|
2005-03-17 11:26:20 +01:00
|
|
|
break;
|
|
|
|
}
|
2011-01-21 14:51:37 +01:00
|
|
|
break;
|
2005-03-17 11:26:20 +01:00
|
|
|
}
|
2018-01-22 17:05:34 +01:00
|
|
|
if (post_quit) PostQuitMessage(exit_code);
|
2006-10-15 12:28:08 +02:00
|
|
|
TRACE("-- 0x%08x\n", hr);
|
2005-03-17 11:26:20 +01:00
|
|
|
return hr;
|
|
|
|
}
|
2005-05-16 16:12:53 +02:00
|
|
|
|
2006-06-28 22:24:38 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoGetObject [OLE32.@]
|
|
|
|
*
|
2008-03-01 21:10:38 +01:00
|
|
|
* Gets the object named by converting the name to a moniker and binding to it.
|
2006-06-28 22:24:38 +02:00
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pszName [I] String representing the object.
|
|
|
|
* pBindOptions [I] Parameters affecting the binding to the named object.
|
|
|
|
* riid [I] Interface to bind to on the objecct.
|
|
|
|
* ppv [O] On output, the interface riid of the object represented
|
|
|
|
* by pszName.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*
|
|
|
|
* SEE ALSO
|
|
|
|
* MkParseDisplayName.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
IBindCtx *pbc;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
hr = CreateBindCtx(0, &pbc);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
if (pBindOptions)
|
|
|
|
hr = IBindCtx_SetBindOptions(pbc, pBindOptions);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
ULONG chEaten;
|
|
|
|
IMoniker *pmk;
|
|
|
|
|
|
|
|
hr = MkParseDisplayName(pbc, pszName, &chEaten, &pmk);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = IMoniker_BindToObject(pmk, pbc, NULL, riid, ppv);
|
|
|
|
IMoniker_Release(pmk);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
IBindCtx_Release(pbc);
|
|
|
|
}
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2006-12-19 20:35:42 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoRegisterChannelHook [OLE32.@]
|
|
|
|
*
|
|
|
|
* Registers a process-wide hook that is called during ORPC calls.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* guidExtension [I] GUID of the channel hook to register.
|
|
|
|
* pChannelHook [I] Channel hook object to register.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRegisterChannelHook(REFGUID guidExtension, IChannelHook *pChannelHook)
|
|
|
|
{
|
|
|
|
TRACE("(%s, %p)\n", debugstr_guid(guidExtension), pChannelHook);
|
|
|
|
|
|
|
|
return RPC_RegisterChannelHook(guidExtension, pChannelHook);
|
|
|
|
}
|
|
|
|
|
2007-11-01 14:27:20 +01:00
|
|
|
typedef struct Context
|
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
IComThreadingInfo IComThreadingInfo_iface;
|
|
|
|
IContextCallback IContextCallback_iface;
|
|
|
|
IObjContext IObjContext_iface;
|
2007-11-01 14:27:20 +01:00
|
|
|
LONG refs;
|
|
|
|
} Context;
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static inline Context *impl_from_IComThreadingInfo( IComThreadingInfo *iface )
|
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
return CONTAINING_RECORD(iface, Context, IComThreadingInfo_iface);
|
2009-01-14 18:28:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline Context *impl_from_IContextCallback( IContextCallback *iface )
|
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
return CONTAINING_RECORD(iface, Context, IContextCallback_iface);
|
2009-01-14 18:28:09 +01:00
|
|
|
}
|
|
|
|
|
2009-06-23 15:25:56 +02:00
|
|
|
static inline Context *impl_from_IObjContext( IObjContext *iface )
|
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
return CONTAINING_RECORD(iface, Context, IObjContext_iface);
|
2009-06-23 15:25:56 +02:00
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static HRESULT Context_QueryInterface(Context *iface, REFIID riid, LPVOID *ppv)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if (IsEqualIID(riid, &IID_IComThreadingInfo) ||
|
|
|
|
IsEqualIID(riid, &IID_IUnknown))
|
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
*ppv = &iface->IComThreadingInfo_iface;
|
2009-06-23 15:25:56 +02:00
|
|
|
}
|
|
|
|
else if (IsEqualIID(riid, &IID_IContextCallback))
|
2009-01-14 18:28:09 +01:00
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
*ppv = &iface->IContextCallback_iface;
|
2009-01-14 18:28:09 +01:00
|
|
|
}
|
2009-06-23 15:25:56 +02:00
|
|
|
else if (IsEqualIID(riid, &IID_IObjContext))
|
|
|
|
{
|
2010-12-08 22:59:44 +01:00
|
|
|
*ppv = &iface->IObjContext_iface;
|
2009-06-23 15:25:56 +02:00
|
|
|
}
|
2009-01-14 18:28:09 +01:00
|
|
|
|
|
|
|
if (*ppv)
|
|
|
|
{
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
2007-11-01 14:27:20 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("interface not implemented %s\n", debugstr_guid(riid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static ULONG Context_AddRef(Context *This)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
|
|
|
return InterlockedIncrement(&This->refs);
|
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static ULONG Context_Release(Context *This)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
2016-03-14 18:30:54 +01:00
|
|
|
/* Context instance is initially created with CoGetContextToken() with refcount set to 0,
|
|
|
|
releasing context while refcount is at 0 destroys it. */
|
|
|
|
if (!This->refs)
|
|
|
|
{
|
2007-11-01 14:27:20 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
2016-03-14 18:30:54 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return InterlockedDecrement(&This->refs);
|
2007-11-01 14:27:20 +01:00
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static HRESULT WINAPI Context_CTI_QueryInterface(IComThreadingInfo *iface, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IComThreadingInfo(iface);
|
|
|
|
return Context_QueryInterface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Context_CTI_AddRef(IComThreadingInfo *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IComThreadingInfo(iface);
|
|
|
|
return Context_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Context_CTI_Release(IComThreadingInfo *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IComThreadingInfo(iface);
|
|
|
|
return Context_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Context_CTI_GetCurrentApartmentType(IComThreadingInfo *iface, APTTYPE *apttype)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
2016-03-14 06:09:59 +01:00
|
|
|
APTTYPEQUALIFIER qualifier;
|
2007-11-01 14:27:20 +01:00
|
|
|
|
|
|
|
TRACE("(%p)\n", apttype);
|
|
|
|
|
2016-03-14 06:09:59 +01:00
|
|
|
return CoGetApartmentType(apttype, &qualifier);
|
2007-11-01 14:27:20 +01:00
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static HRESULT WINAPI Context_CTI_GetCurrentThreadType(IComThreadingInfo *iface, THDTYPE *thdtype)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
2016-03-14 06:09:59 +01:00
|
|
|
APTTYPEQUALIFIER qualifier;
|
|
|
|
APTTYPE apttype;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoGetApartmentType(&apttype, &qualifier);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
2007-11-01 14:27:20 +01:00
|
|
|
|
|
|
|
TRACE("(%p)\n", thdtype);
|
|
|
|
|
2016-03-14 06:09:59 +01:00
|
|
|
switch (apttype)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
|
|
|
case APTTYPE_STA:
|
|
|
|
case APTTYPE_MAINSTA:
|
|
|
|
*thdtype = THDTYPE_PROCESSMESSAGES;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
*thdtype = THDTYPE_BLOCKMESSAGES;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static HRESULT WINAPI Context_CTI_GetCurrentLogicalThreadId(IComThreadingInfo *iface, GUID *logical_thread_id)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
2016-03-10 10:51:34 +01:00
|
|
|
TRACE("(%p)\n", logical_thread_id);
|
|
|
|
return CoGetCurrentLogicalThreadId(logical_thread_id);
|
2007-11-01 14:27:20 +01:00
|
|
|
}
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static HRESULT WINAPI Context_CTI_SetCurrentLogicalThreadId(IComThreadingInfo *iface, REFGUID logical_thread_id)
|
2007-11-01 14:27:20 +01:00
|
|
|
{
|
|
|
|
FIXME("(%s): stub\n", debugstr_guid(logical_thread_id));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IComThreadingInfoVtbl Context_Threading_Vtbl =
|
|
|
|
{
|
2009-01-14 18:28:09 +01:00
|
|
|
Context_CTI_QueryInterface,
|
|
|
|
Context_CTI_AddRef,
|
|
|
|
Context_CTI_Release,
|
|
|
|
Context_CTI_GetCurrentApartmentType,
|
|
|
|
Context_CTI_GetCurrentThreadType,
|
|
|
|
Context_CTI_GetCurrentLogicalThreadId,
|
|
|
|
Context_CTI_SetCurrentLogicalThreadId
|
2007-11-01 14:27:20 +01:00
|
|
|
};
|
|
|
|
|
2009-01-14 18:28:09 +01:00
|
|
|
static HRESULT WINAPI Context_CC_QueryInterface(IContextCallback *iface, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IContextCallback(iface);
|
|
|
|
return Context_QueryInterface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Context_CC_AddRef(IContextCallback *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IContextCallback(iface);
|
|
|
|
return Context_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Context_CC_Release(IContextCallback *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IContextCallback(iface);
|
|
|
|
return Context_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Context_CC_ContextCallback(IContextCallback *iface, PFNCONTEXTCALL pCallback,
|
|
|
|
ComCallData *param, REFIID riid, int method, IUnknown *punk)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IContextCallback(iface);
|
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p, %p, %s, %d, %p)\n", This, iface, pCallback, param, debugstr_guid(riid), method, punk);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IContextCallbackVtbl Context_Callback_Vtbl =
|
|
|
|
{
|
|
|
|
Context_CC_QueryInterface,
|
|
|
|
Context_CC_AddRef,
|
|
|
|
Context_CC_Release,
|
|
|
|
Context_CC_ContextCallback
|
|
|
|
};
|
|
|
|
|
2009-06-23 15:25:56 +02:00
|
|
|
static HRESULT WINAPI Context_OC_QueryInterface(IObjContext *iface, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
return Context_QueryInterface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Context_OC_AddRef(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
return Context_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Context_OC_Release(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
return Context_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Context_OC_SetProperty(IObjContext *iface, REFGUID propid, CPFLAGS flags, IUnknown *punk)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%s, %x, %p)\n", This, iface, debugstr_guid(propid), flags, punk);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Context_OC_RemoveProperty(IObjContext *iface, REFGUID propid)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%s)\n", This, iface, debugstr_guid(propid));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Context_OC_GetProperty(IObjContext *iface, REFGUID propid, CPFLAGS *flags, IUnknown **punk)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%s, %p, %p)\n", This, iface, debugstr_guid(propid), flags, punk);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Context_OC_EnumContextProps(IObjContext *iface, IEnumContextProps **props)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p)\n", This, iface, props);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved1(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved2(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved3(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved4(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved5(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved6(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WINAPI Context_OC_Reserved7(IObjContext *iface)
|
|
|
|
{
|
|
|
|
Context *This = impl_from_IObjContext(iface);
|
|
|
|
FIXME("(%p/%p)\n", This, iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IObjContextVtbl Context_Object_Vtbl =
|
|
|
|
{
|
|
|
|
Context_OC_QueryInterface,
|
|
|
|
Context_OC_AddRef,
|
|
|
|
Context_OC_Release,
|
|
|
|
Context_OC_SetProperty,
|
|
|
|
Context_OC_RemoveProperty,
|
|
|
|
Context_OC_GetProperty,
|
|
|
|
Context_OC_EnumContextProps,
|
|
|
|
Context_OC_Reserved1,
|
|
|
|
Context_OC_Reserved2,
|
|
|
|
Context_OC_Reserved3,
|
|
|
|
Context_OC_Reserved4,
|
|
|
|
Context_OC_Reserved5,
|
|
|
|
Context_OC_Reserved6,
|
|
|
|
Context_OC_Reserved7
|
|
|
|
};
|
2009-01-14 18:28:09 +01:00
|
|
|
|
2007-11-01 14:27:20 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetObjectContext [OLE32.@]
|
|
|
|
*
|
|
|
|
* Retrieves an object associated with the current context (i.e. apartment).
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* riid [I] ID of the interface of the object to retrieve.
|
|
|
|
* ppv [O] Address where object will be stored on return.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK.
|
|
|
|
* Failure: HRESULT code.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv)
|
|
|
|
{
|
2016-03-14 18:30:54 +01:00
|
|
|
IObjContext *context;
|
2007-11-01 14:27:20 +01:00
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
*ppv = NULL;
|
2016-03-14 18:30:54 +01:00
|
|
|
hr = CoGetContextToken((ULONG_PTR*)&context);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
2007-11-01 14:27:20 +01:00
|
|
|
|
2016-03-14 18:30:54 +01:00
|
|
|
return IObjContext_QueryInterface(context, riid, ppv);
|
2007-11-01 14:27:20 +01:00
|
|
|
}
|
|
|
|
|
2008-02-26 11:21:54 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetContextToken [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetContextToken( ULONG_PTR *token )
|
|
|
|
{
|
2009-01-18 15:18:03 +01:00
|
|
|
struct oletls *info = COM_CurrentInfo();
|
2009-06-23 15:25:56 +02:00
|
|
|
|
|
|
|
TRACE("(%p)\n", token);
|
|
|
|
|
2009-01-18 15:18:03 +01:00
|
|
|
if (!info)
|
|
|
|
return E_OUTOFMEMORY;
|
2009-06-23 15:25:56 +02:00
|
|
|
|
|
|
|
if (!info->apt)
|
2009-07-03 11:32:08 +02:00
|
|
|
{
|
|
|
|
APARTMENT *apt;
|
|
|
|
if (!(apt = apartment_find_multi_threaded()))
|
|
|
|
{
|
|
|
|
ERR("apartment not initialised\n");
|
|
|
|
return CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
apartment_release(apt);
|
|
|
|
}
|
2009-06-23 15:25:56 +02:00
|
|
|
|
|
|
|
if (!token)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
if (!info->context_token)
|
|
|
|
{
|
2016-03-14 18:30:54 +01:00
|
|
|
Context *context;
|
|
|
|
|
|
|
|
context = HeapAlloc(GetProcessHeap(), 0, sizeof(*context));
|
|
|
|
if (!context)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
context->IComThreadingInfo_iface.lpVtbl = &Context_Threading_Vtbl;
|
|
|
|
context->IContextCallback_iface.lpVtbl = &Context_Callback_Vtbl;
|
|
|
|
context->IObjContext_iface.lpVtbl = &Context_Object_Vtbl;
|
2016-05-29 12:41:43 +02:00
|
|
|
/* Context token does not take a reference, it's always zero until the
|
|
|
|
interface is explicitly requested with CoGetObjectContext(). */
|
2016-03-14 18:30:54 +01:00
|
|
|
context->refs = 0;
|
2009-06-23 15:25:56 +02:00
|
|
|
|
2016-03-14 18:30:54 +01:00
|
|
|
info->context_token = &context->IObjContext_iface;
|
2009-06-23 15:25:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
*token = (ULONG_PTR)info->context_token;
|
2016-03-14 18:30:54 +01:00
|
|
|
TRACE("context_token=%p\n", info->context_token);
|
2009-06-23 15:25:56 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2008-02-26 11:21:54 +01:00
|
|
|
}
|
|
|
|
|
2012-09-23 06:02:21 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetDefaultContext [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetDefaultContext(APTTYPE type, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
FIXME("%d %s %p stub\n", type, debugstr_guid(riid), ppv);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2009-11-23 16:07:49 +01:00
|
|
|
HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
static const WCHAR wszInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
|
|
|
|
HKEY hkey;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = COM_OpenKeyForCLSID(rclsid, wszInprocHandler32, KEY_READ, &hkey);
|
|
|
|
if (SUCCEEDED(hres))
|
|
|
|
{
|
2013-09-27 06:47:15 +02:00
|
|
|
struct class_reg_data regdata;
|
2009-11-23 16:07:49 +01:00
|
|
|
WCHAR dllpath[MAX_PATH+1];
|
|
|
|
|
2013-09-27 06:47:15 +02:00
|
|
|
regdata.u.hkey = hkey;
|
|
|
|
regdata.hkey = TRUE;
|
|
|
|
|
|
|
|
if (COM_RegReadPath(®data, dllpath, ARRAYSIZE(dllpath)) == ERROR_SUCCESS)
|
2009-11-23 16:07:49 +01:00
|
|
|
{
|
|
|
|
static const WCHAR wszOle32[] = {'o','l','e','3','2','.','d','l','l',0};
|
|
|
|
if (!strcmpiW(dllpath, wszOle32))
|
|
|
|
{
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
return HandlerCF_Create(rclsid, riid, ppv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
WARN("not creating object for inproc handler path %s\n", debugstr_w(dllpath));
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
|
|
|
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|
2008-02-26 11:21:54 +01:00
|
|
|
|
2016-03-02 16:19:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CoGetApartmentType [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoGetApartmentType(APTTYPE *type, APTTYPEQUALIFIER *qualifier)
|
|
|
|
{
|
|
|
|
struct oletls *info = COM_CurrentInfo();
|
|
|
|
|
|
|
|
FIXME("(%p, %p): semi-stub\n", type, qualifier);
|
|
|
|
|
|
|
|
if (!type || !qualifier)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (!info)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
if (!info->apt)
|
|
|
|
*type = APTTYPE_CURRENT;
|
|
|
|
else if (info->apt->multi_threaded)
|
|
|
|
*type = APTTYPE_MTA;
|
|
|
|
else if (info->apt->main)
|
|
|
|
*type = APTTYPE_MAINSTA;
|
|
|
|
else
|
|
|
|
*type = APTTYPE_STA;
|
|
|
|
|
|
|
|
*qualifier = APTTYPEQUALIFIER_NONE;
|
|
|
|
|
|
|
|
return info->apt ? S_OK : CO_E_NOTINITIALIZED;
|
|
|
|
}
|
|
|
|
|
2017-03-28 09:37:11 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CoRegisterSurrogate [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRegisterSurrogate(ISurrogate *surrogate)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", surrogate);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CoRegisterSurrogateEx [OLE32.@]
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoRegisterSurrogateEx(REFGUID guid, void *reserved)
|
|
|
|
{
|
|
|
|
FIXME("(%s %p): stub\n", debugstr_guid(guid), reserved);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2017-02-22 12:28:57 +01:00
|
|
|
typedef struct {
|
|
|
|
IGlobalOptions IGlobalOptions_iface;
|
|
|
|
LONG ref;
|
|
|
|
} GlobalOptions;
|
|
|
|
|
|
|
|
static inline GlobalOptions *impl_from_IGlobalOptions(IGlobalOptions *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, GlobalOptions, IGlobalOptions_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GlobalOptions_QueryInterface(IGlobalOptions *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
GlobalOptions *This = impl_from_IGlobalOptions(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if (IsEqualGUID(&IID_IGlobalOptions, riid) || IsEqualGUID(&IID_IUnknown, riid))
|
|
|
|
{
|
|
|
|
*ppv = iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI GlobalOptions_AddRef(IGlobalOptions *iface)
|
|
|
|
{
|
|
|
|
GlobalOptions *This = impl_from_IGlobalOptions(iface);
|
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI GlobalOptions_Release(IGlobalOptions *iface)
|
|
|
|
{
|
|
|
|
GlobalOptions *This = impl_from_IGlobalOptions(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
heap_free(This);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GlobalOptions_Set(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR value)
|
|
|
|
{
|
|
|
|
GlobalOptions *This = impl_from_IGlobalOptions(iface);
|
|
|
|
FIXME("(%p)->(%u %lx)\n", This, property, value);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GlobalOptions_Query(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR *value)
|
|
|
|
{
|
|
|
|
GlobalOptions *This = impl_from_IGlobalOptions(iface);
|
|
|
|
FIXME("(%p)->(%u %p)\n", This, property, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IGlobalOptionsVtbl GlobalOptionsVtbl = {
|
|
|
|
GlobalOptions_QueryInterface,
|
|
|
|
GlobalOptions_AddRef,
|
|
|
|
GlobalOptions_Release,
|
|
|
|
GlobalOptions_Set,
|
|
|
|
GlobalOptions_Query
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI GlobalOptions_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
GlobalOptions *global_options;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if (outer)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
global_options = heap_alloc(sizeof(*global_options));
|
|
|
|
if (!global_options)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
global_options->IGlobalOptions_iface.lpVtbl = &GlobalOptionsVtbl;
|
|
|
|
global_options->ref = 1;
|
|
|
|
|
|
|
|
hres = IGlobalOptions_QueryInterface(&global_options->IGlobalOptions_iface, riid, ppv);
|
|
|
|
IGlobalOptions_Release(&global_options->IGlobalOptions_iface);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2005-05-16 16:12:53 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* DllMain (OLE32.@)
|
|
|
|
*/
|
2013-05-14 11:25:29 +02:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID reserved)
|
2005-05-16 16:12:53 +02:00
|
|
|
{
|
2013-05-14 11:25:29 +02:00
|
|
|
TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, reserved);
|
2005-05-16 16:12:53 +02:00
|
|
|
|
|
|
|
switch(fdwReason) {
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2008-12-02 20:52:09 +01:00
|
|
|
hProxyDll = hinstDLL;
|
2005-05-16 16:12:53 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
2013-05-14 11:25:29 +02:00
|
|
|
if (reserved) break;
|
2013-08-23 08:34:48 +02:00
|
|
|
release_std_git();
|
2013-10-17 17:55:03 +02:00
|
|
|
UnregisterClassW( wszAptWinClass, hProxyDll );
|
2006-12-19 20:35:42 +01:00
|
|
|
RPC_UnregisterAllChannelHooks();
|
2007-11-10 17:06:35 +01:00
|
|
|
COMPOBJ_DllList_Free();
|
2011-11-17 09:53:19 +01:00
|
|
|
DeleteCriticalSection(&csRegisteredClassList);
|
|
|
|
DeleteCriticalSection(&csApartment);
|
2005-05-16 16:12:53 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_THREAD_DETACH:
|
|
|
|
COM_TlsDestroy();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2010-12-03 19:51:08 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer (OLE32.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
|
|
|
return OLE32_DllRegisterServer();
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer (OLE32.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
{
|
|
|
|
return OLE32_DllUnregisterServer();
|
|
|
|
}
|