Author: fireball
Date: Tue Apr 20 19:36:44 2010
New Revision: 46959
URL:
http://svn.reactos.org/svn/reactos?rev=46959&view=rev
Log:
- Add Wow64* functions declarations to winbase.h
- Export Wow64* functions in kernel32, because 32bit Windows also exports them.
- Sync ole32, oleaut32 with Wine-1.1.43.
Modified:
trunk/reactos/dll/win32/kernel32/kernel32.pspec
trunk/reactos/dll/win32/ole32/compobj.c
trunk/reactos/dll/win32/ole32/ftmarshal.c
trunk/reactos/dll/win32/ole32/ifs.c
trunk/reactos/dll/win32/ole32/moniker.c
trunk/reactos/dll/win32/ole32/ole32.rbuild
trunk/reactos/dll/win32/ole32/rpc.c
trunk/reactos/dll/win32/ole32/storage32.c
trunk/reactos/dll/win32/ole32/storage32.h
trunk/reactos/dll/win32/oleaut32/olepicture.c
trunk/reactos/dll/win32/oleaut32/regsvr.c
trunk/reactos/dll/win32/oleaut32/typelib.c
trunk/reactos/dll/win32/oleaut32/typelib2.c
trunk/reactos/dll/win32/oleaut32/vartype.c
trunk/reactos/include/psdk/winbase.h
Modified: trunk/reactos/dll/win32/kernel32/kernel32.pspec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -966,11 +966,9 @@
@ stdcall WaitNamedPipeW (wstr long)
@ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr)
@ stdcall WinExec(str long)
-#ifdef _M_AMD64
@ stdcall Wow64EnableWow64FsRedirection(long)
@ stdcall Wow64DisableWow64FsRedirection(long)
@ stdcall Wow64RevertWow64FsRedirection(long)
-#endif
@ stdcall WriteConsoleA(long ptr long ptr ptr)
@ stdcall WriteConsoleInputA(long ptr long ptr)
@ stdcall WriteConsoleInputVDMA(long long long long)
Modified: trunk/reactos/dll/win32/ole32/compobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?…
==============================================================================
--- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -1506,7 +1506,7 @@
* SEE ALSO
* StringFromCLSID
*/
-static HRESULT __CLSIDFromString(LPCWSTR s, CLSID *id)
+static HRESULT __CLSIDFromString(LPCWSTR s, LPCLSID id)
{
int i;
BYTE table[256];
@@ -4153,11 +4153,9 @@
case DLL_PROCESS_ATTACH:
hProxyDll = hinstDLL;
COMPOBJ_InitProcess();
- if (TRACE_ON(ole)) CoRegisterMallocSpy((LPVOID)-1);
break;
case DLL_PROCESS_DETACH:
- if (TRACE_ON(ole)) CoRevokeMallocSpy();
OLEDD_UnInitialize();
COMPOBJ_UninitProcess();
RPC_UnregisterAllChannelHooks();
Modified: trunk/reactos/dll/win32/ole32/ftmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ftmarshal.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/ftmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/ftmarshal.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -204,8 +204,11 @@
hres = IStream_Write (pStm, &object, sizeof (object), NULL);
if (hres != S_OK) return STG_E_MEDIUMFULL;
- hres = IStream_Write (pStm, &constant, sizeof (constant), NULL);
- if (hres != S_OK) return STG_E_MEDIUMFULL;
+ if (sizeof(object) == sizeof(DWORD))
+ {
+ hres = IStream_Write (pStm, &constant, sizeof (constant), NULL);
+ if (hres != S_OK) return STG_E_MEDIUMFULL;
+ }
hres = IStream_Write (pStm, &unknown_guid, sizeof (unknown_guid), NULL);
if (hres != S_OK) return STG_E_MEDIUMFULL;
@@ -237,10 +240,13 @@
hres = IStream_Read (pStm, &object, sizeof (object), NULL);
if (hres != S_OK) return STG_E_READFAULT;
- hres = IStream_Read (pStm, &constant, sizeof (constant), NULL);
- if (hres != S_OK) return STG_E_READFAULT;
- if (constant != 0)
- FIXME("constant is 0x%x instead of 0\n", constant);
+ if (sizeof(object) == sizeof(DWORD))
+ {
+ hres = IStream_Read (pStm, &constant, sizeof (constant), NULL);
+ if (hres != S_OK) return STG_E_READFAULT;
+ if (constant != 0)
+ FIXME("constant is 0x%x instead of 0\n", constant);
+ }
hres = IStream_Read (pStm, &unknown_guid, sizeof (unknown_guid), NULL);
if (hres != S_OK) return STG_E_READFAULT;
@@ -267,10 +273,13 @@
hres = IStream_Read (pStm, &object, sizeof (object), NULL);
if (hres != S_OK) return STG_E_READFAULT;
- hres = IStream_Read (pStm, &constant, sizeof (constant), NULL);
- if (hres != S_OK) return STG_E_READFAULT;
- if (constant != 0)
- FIXME("constant is 0x%x instead of 0\n", constant);
+ if (sizeof(object) == sizeof(DWORD))
+ {
+ hres = IStream_Read (pStm, &constant, sizeof (constant), NULL);
+ if (hres != S_OK) return STG_E_READFAULT;
+ if (constant != 0)
+ FIXME("constant is 0x%x instead of 0\n", constant);
+ }
hres = IStream_Read (pStm, &unknown_guid, sizeof (unknown_guid), NULL);
if (hres != S_OK) return STG_E_READFAULT;
Modified: trunk/reactos/dll/win32/ole32/ifs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ifs.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -360,173 +360,6 @@
};
/******************************************************************************
- * IMallocSpy implementation
- *****************************************************************************/
-
-/* set the vtable later */
-static const IMallocSpyVtbl VT_IMallocSpy;
-
-typedef struct {
- const IMallocSpyVtbl *lpVtbl;
- LONG ref;
-} _MallocSpy;
-
-/* this is the static object instance */
-static _MallocSpy MallocSpy = {&VT_IMallocSpy, 0};
-
-/******************************************************************************
- * IMalloc32_QueryInterface [VTABLE]
- */
-static HRESULT WINAPI IMallocSpy_fnQueryInterface(LPMALLOCSPY iface,REFIID refiid,LPVOID
*obj)
-{
-
- TRACE("(%s,%p)\n",debugstr_guid(refiid),obj);
-
- if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMallocSpy,refiid)) {
- *obj = &MallocSpy;
- return S_OK;
- }
- return E_NOINTERFACE;
-}
-
-/******************************************************************************
- * IMalloc32_AddRef [VTABLE]
- */
-static ULONG WINAPI IMallocSpy_fnAddRef (LPMALLOCSPY iface)
-{
-
- _MallocSpy *This = (_MallocSpy *)iface;
- ULONG ref = InterlockedIncrement(&This->ref);
-
- TRACE ("(%p)->(count=%u)\n", This, ref - 1);
-
- return ref;
-}
-
-/******************************************************************************
- * IMalloc32_AddRelease [VTABLE]
- *
- * NOTES
- * Our MallocSpy is static. If the count reaches 0 we dump the leaks
- */
-static ULONG WINAPI IMallocSpy_fnRelease (LPMALLOCSPY iface)
-{
-
- _MallocSpy *This = (_MallocSpy *)iface;
- ULONG ref = InterlockedDecrement(&This->ref);
-
- TRACE ("(%p)->(count=%u)\n", This, ref + 1);
-
- if (!ref) {
- /* our allocation list MUST be empty here */
- }
- return ref;
-}
-
-static ULONG WINAPI IMallocSpy_fnPreAlloc(LPMALLOCSPY iface, ULONG cbRequest)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%u)\n", This, cbRequest);
- return cbRequest;
-}
-static PVOID WINAPI IMallocSpy_fnPostAlloc(LPMALLOCSPY iface, void* pActual)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p)\n", This, pActual);
- return pActual;
-}
-
-static PVOID WINAPI IMallocSpy_fnPreFree(LPMALLOCSPY iface, void* pRequest, BOOL fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p %u)\n", This, pRequest, fSpyed);
- return pRequest;
-}
-static void WINAPI IMallocSpy_fnPostFree(LPMALLOCSPY iface, BOOL fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%u)\n", This, fSpyed);
-}
-
-static ULONG WINAPI IMallocSpy_fnPreRealloc(LPMALLOCSPY iface, void* pRequest, ULONG
cbRequest, void** ppNewRequest, BOOL fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p %u %u)\n", This, pRequest, cbRequest, fSpyed);
- *ppNewRequest = pRequest;
- return cbRequest;
-}
-
-static PVOID WINAPI IMallocSpy_fnPostRealloc(LPMALLOCSPY iface, void* pActual, BOOL
fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p %u)\n", This, pActual, fSpyed);
- return pActual;
-}
-
-static PVOID WINAPI IMallocSpy_fnPreGetSize(LPMALLOCSPY iface, void* pRequest, BOOL
fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p %u)\n", This, pRequest, fSpyed);
- return pRequest;
-}
-
-static ULONG WINAPI IMallocSpy_fnPostGetSize(LPMALLOCSPY iface, ULONG cbActual, BOOL
fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%u %u)\n", This, cbActual, fSpyed);
- return cbActual;
-}
-
-static PVOID WINAPI IMallocSpy_fnPreDidAlloc(LPMALLOCSPY iface, void* pRequest, BOOL
fSpyed)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p %u)\n", This, pRequest, fSpyed);
- return pRequest;
-}
-
-static int WINAPI IMallocSpy_fnPostDidAlloc(LPMALLOCSPY iface, void* pRequest, BOOL
fSpyed, int fActual)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->(%p %u %u)\n", This, pRequest, fSpyed, fActual);
- return fActual;
-}
-
-static void WINAPI IMallocSpy_fnPreHeapMinimize(LPMALLOCSPY iface)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->()\n", This);
-}
-
-static void WINAPI IMallocSpy_fnPostHeapMinimize(LPMALLOCSPY iface)
-{
- _MallocSpy *This = (_MallocSpy *)iface;
- TRACE ("(%p)->()\n", This);
-}
-
-static void MallocSpyDumpLeaks(void) {
- TRACE("leaks: %u\n", Malloc32.SpyedAllocationsLeft);
-}
-
-static const IMallocSpyVtbl VT_IMallocSpy =
-{
- IMallocSpy_fnQueryInterface,
- IMallocSpy_fnAddRef,
- IMallocSpy_fnRelease,
- IMallocSpy_fnPreAlloc,
- IMallocSpy_fnPostAlloc,
- IMallocSpy_fnPreFree,
- IMallocSpy_fnPostFree,
- IMallocSpy_fnPreRealloc,
- IMallocSpy_fnPostRealloc,
- IMallocSpy_fnPreGetSize,
- IMallocSpy_fnPostGetSize,
- IMallocSpy_fnPreDidAlloc,
- IMallocSpy_fnPostDidAlloc,
- IMallocSpy_fnPreHeapMinimize,
- IMallocSpy_fnPostHeapMinimize
-};
-
-/******************************************************************************
* CoGetMalloc [OLE32.@]
*
* Retrieves the current IMalloc interface for the process.
@@ -620,9 +453,6 @@
TRACE("\n");
- /* HACK TO ACTIVATE OUT SPY */
- if (pMallocSpy == (LPVOID)-1) pMallocSpy =(IMallocSpy*)&MallocSpy;
-
if(Malloc32.pSpy) return CO_E_OBJISREG;
EnterCriticalSection(&IMalloc32_SpyCS);
@@ -660,11 +490,6 @@
TRACE("\n");
EnterCriticalSection(&IMalloc32_SpyCS);
-
- /* if it's our spy it's time to dump the leaks */
- if (Malloc32.pSpy == (IMallocSpy*)&MallocSpy) {
- MallocSpyDumpLeaks();
- }
if (Malloc32.SpyedAllocationsLeft) {
TRACE("SpyReleasePending with %u allocations left\n",
Malloc32.SpyedAllocationsLeft);
Modified: trunk/reactos/dll/win32/ole32/moniker.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/moniker.c?…
==============================================================================
--- trunk/reactos/dll/win32/ole32/moniker.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/moniker.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -127,6 +127,7 @@
WCHAR cmd[MAX_PATH];
static const WCHAR rpcss[] =
{'\\','r','p','c','s','s','.','e','x','e',0};
BOOL rslt;
+ void *redir;
TRACE("\n");
@@ -135,7 +136,9 @@
GetSystemDirectoryW( cmd, MAX_PATH - sizeof(rpcss)/sizeof(WCHAR) );
strcatW( cmd, rpcss );
+ Wow64DisableWow64FsRedirection( &redir );
rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi
);
+ Wow64RevertWow64FsRedirection( redir );
if (rslt)
{
Modified: trunk/reactos/dll/win32/ole32/ole32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32.rbui…
==============================================================================
--- trunk/reactos/dll/win32/ole32/ole32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/ole32.rbuild [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -20,6 +20,7 @@
<library>ole32_irot_client</library>
<library>ole32_proxy</library>
<library>rpcrt4</library>
+ <library>kernel32</library>
<library>ntdll</library>
<library>uuid</library>
<library>pseh</library>
Modified: trunk/reactos/dll/win32/ole32/rpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/rpc.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/rpc.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -144,6 +144,28 @@
/* [size_is((size+7)&~7)] */ unsigned char data[1];
} WIRE_ORPC_EXTENT;
+typedef struct
+{
+ ULONG size;
+ ULONG reserved;
+ unsigned char extent[1];
+} WIRE_ORPC_EXTENT_ARRAY;
+
+typedef struct
+{
+ ULONG version;
+ ULONG flags;
+ ULONG reserved1;
+ GUID cid;
+ unsigned char extensions[1];
+} WIRE_ORPCTHIS;
+
+typedef struct
+{
+ ULONG flags;
+ unsigned char extensions[1];
+} WIRE_ORPCTHAT;
+
struct channel_hook_entry
{
struct list entry;
@@ -503,10 +525,10 @@
extensions_size =
ChannelHooks_ServerGetSize(&message_state->channel_hook_info,
&channel_hook_data,
&channel_hook_count, &extension_count);
- msg->BufferLength += FIELD_OFFSET(ORPCTHAT, extensions) + 4;
+ msg->BufferLength += FIELD_OFFSET(WIRE_ORPCTHAT, extensions) + sizeof(DWORD);
if (extensions_size)
{
- msg->BufferLength += FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent) + 2*sizeof(DWORD)
+ extensions_size;
+ msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY,
extent[2*sizeof(DWORD) + extensions_size]);
if (extension_count & 1)
msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]);
}
@@ -523,7 +545,7 @@
status = I_RpcGetBuffer(msg);
orpcthat = msg->Buffer;
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHAT, extensions);
+ msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHAT, extensions);
orpcthat->flags = ORPCF_NULL /* FIXME? */;
@@ -533,10 +555,10 @@
if (extensions_size)
{
- ORPC_EXTENT_ARRAY *orpc_extent_array = msg->Buffer;
+ WIRE_ORPC_EXTENT_ARRAY *orpc_extent_array = msg->Buffer;
orpc_extent_array->size = extension_count;
orpc_extent_array->reserved = 0;
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPC_EXTENT_ARRAY,
extent);
+ msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY,
extent);
/* NDR representation of orpc_extent_array->extent */
*(DWORD *)msg->Buffer = 1;
msg->Buffer = (char *)msg->Buffer + sizeof(DWORD);
@@ -645,10 +667,10 @@
extensions_size =
ChannelHooks_ClientGetSize(&message_state->channel_hook_info,
&channel_hook_data, &channel_hook_count, &extension_count);
- msg->BufferLength += FIELD_OFFSET(ORPCTHIS, extensions) + 4;
+ msg->BufferLength += FIELD_OFFSET(WIRE_ORPCTHIS, extensions) + sizeof(DWORD);
if (extensions_size)
{
- msg->BufferLength += FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent) + 2*sizeof(DWORD)
+ extensions_size;
+ msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY,
extent[2*sizeof(DWORD) + extensions_size]);
if (extension_count & 1)
msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]);
}
@@ -703,7 +725,7 @@
if (status == RPC_S_OK)
{
orpcthis = msg->Buffer;
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHIS, extensions);
+ msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHIS,
extensions);
orpcthis->version.MajorVersion = COM_MAJOR_VERSION;
orpcthis->version.MinorVersion = COM_MINOR_VERSION;
@@ -720,7 +742,7 @@
ORPC_EXTENT_ARRAY *orpc_extent_array = msg->Buffer;
orpc_extent_array->size = extension_count;
orpc_extent_array->reserved = 0;
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPC_EXTENT_ARRAY,
extent);
+ msg->Buffer = (char *)msg->Buffer +
FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent);
/* NDR representation of orpc_extent_array->extent */
*(DWORD *)msg->Buffer = 1;
msg->Buffer = (char *)msg->Buffer + sizeof(DWORD);
@@ -1152,8 +1174,8 @@
DWORD pointer_id;
DWORD i;
- memcpy(extensions, msg->Buffer, FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent));
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent);
+ memcpy(extensions, msg->Buffer, FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent));
+ msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY,
extent);
if ((const char *)msg->Buffer + 2 * sizeof(DWORD) > end)
return RPC_E_INVALID_HEADER;
@@ -1205,14 +1227,14 @@
*first_wire_orpc_extent = NULL;
- if (msg->BufferLength < FIELD_OFFSET(ORPCTHIS, extensions) + 4)
+ if (msg->BufferLength < FIELD_OFFSET(WIRE_ORPCTHIS, extensions) +
sizeof(DWORD))
{
ERR("invalid buffer length\n");
return RPC_E_INVALID_HEADER;
}
- memcpy(orpcthis, msg->Buffer, FIELD_OFFSET(ORPCTHIS, extensions));
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHIS, extensions);
+ memcpy(orpcthis, msg->Buffer, FIELD_OFFSET(WIRE_ORPCTHIS, extensions));
+ msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHIS, extensions);
if ((const char *)msg->Buffer + sizeof(DWORD) > end)
return RPC_E_INVALID_HEADER;
@@ -1256,14 +1278,14 @@
*first_wire_orpc_extent = NULL;
- if (msg->BufferLength < FIELD_OFFSET(ORPCTHAT, extensions) + 4)
+ if (msg->BufferLength < FIELD_OFFSET(WIRE_ORPCTHAT, extensions) +
sizeof(DWORD))
{
ERR("invalid buffer length\n");
return RPC_E_INVALID_HEADER;
}
- memcpy(orpcthat, msg->Buffer, FIELD_OFFSET(ORPCTHAT, extensions));
- msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHAT, extensions);
+ memcpy(orpcthat, msg->Buffer, FIELD_OFFSET(WIRE_ORPCTHAT, extensions));
+ msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHAT, extensions);
if ((const char *)msg->Buffer + sizeof(DWORD) > end)
return RPC_E_INVALID_HEADER;
Modified: trunk/reactos/dll/win32/ole32/storage32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -2583,6 +2583,7 @@
DWORD openFlags,
BOOL fileBased,
BOOL create,
+ ULONG sector_size,
StorageImpl** result)
{
StorageImpl* This;
@@ -2634,7 +2635,7 @@
/*
* Initialize the big block cache.
*/
- This->bigBlockSize = DEF_BIG_BLOCK_SIZE;
+ This->bigBlockSize = sector_size;
This->smallBlockSize = DEF_SMALL_BLOCK_SIZE;
This->bigBlockFile = BIGBLOCKFILE_Construct(hFile,
pLkbyt,
@@ -2665,8 +2666,12 @@
This->bigBlockDepotCount = 1;
This->bigBlockDepotStart[0] = 0;
This->rootStartBlock = 1;
+ This->smallBlockLimit = LIMIT_TO_USE_SMALL_BLOCK;
This->smallBlockDepotStart = BLOCK_END_OF_CHAIN;
- This->bigBlockSizeBits = DEF_BIG_BLOCK_SIZE_BITS;
+ if (sector_size == 4096)
+ This->bigBlockSizeBits = MAX_BIG_BLOCK_SIZE_BITS;
+ else
+ This->bigBlockSizeBits = MIN_BIG_BLOCK_SIZE_BITS;
This->smallBlockSizeBits = DEF_SMALL_BLOCK_SIZE_BITS;
This->extBigBlockDepotStart = BLOCK_END_OF_CHAIN;
This->extBigBlockDepotCount = 0;
@@ -2710,6 +2715,8 @@
* Start searching for free blocks with block 0.
*/
This->prevFreeBlock = 0;
+
+ This->firstFreeSmallBlock = 0;
/*
* Create the block chain abstractions.
@@ -3350,6 +3357,11 @@
StorageUtl_ReadDWord(
headerBigBlock,
+ OFFSET_SMALLBLOCKLIMIT,
+ &This->smallBlockLimit);
+
+ StorageUtl_ReadDWord(
+ headerBigBlock,
OFFSET_SBDEPOTSTART,
&This->smallBlockDepotStart);
@@ -3382,9 +3394,11 @@
* blocks, just make sure they are what we're expecting.
*/
if ((This->bigBlockSize != MIN_BIG_BLOCK_SIZE && This->bigBlockSize !=
MAX_BIG_BLOCK_SIZE) ||
- This->smallBlockSize != DEF_SMALL_BLOCK_SIZE)
- {
- WARN("Broken OLE storage file\n");
+ This->smallBlockSize != DEF_SMALL_BLOCK_SIZE ||
+ This->smallBlockLimit != LIMIT_TO_USE_SMALL_BLOCK)
+ {
+ FIXME("Broken OLE storage file? bigblock=0x%x, smallblock=0x%x,
sblimit=0x%x\n",
+ This->bigBlockSize, This->smallBlockSize, This->smallBlockLimit);
hr = STG_E_INVALIDHEADER;
}
else
@@ -3438,7 +3452,6 @@
StorageUtl_WriteWord(headerBigBlock, 0x18, 0x3b);
StorageUtl_WriteWord(headerBigBlock, 0x1a, 0x3);
StorageUtl_WriteWord(headerBigBlock, 0x1c, (WORD)-2);
- StorageUtl_WriteDWord(headerBigBlock, 0x38, (DWORD)0x1000);
}
/*
@@ -3463,6 +3476,11 @@
headerBigBlock,
OFFSET_ROOTSTARTBLOCK,
This->rootStartBlock);
+
+ StorageUtl_WriteDWord(
+ headerBigBlock,
+ OFFSET_SMALLBLOCKLIMIT,
+ This->smallBlockLimit);
StorageUtl_WriteDWord(
headerBigBlock,
@@ -4341,13 +4359,14 @@
DWORD openFlags,
BOOL fileBased,
BOOL create,
+ ULONG sector_size,
StorageBaseImpl** result)
{
StorageImpl *newStorage;
StorageBaseImpl *newTransactedStorage;
HRESULT hr;
- hr = StorageImpl_Construct(hFile, pwcsName, pLkbyt, openFlags, fileBased, create,
&newStorage);
+ hr = StorageImpl_Construct(hFile, pwcsName, pLkbyt, openFlags, fileBased, create,
sector_size, &newStorage);
if (FAILED(hr)) goto end;
if (openFlags & STGM_TRANSACTED)
@@ -4840,6 +4859,7 @@
* Initialize the virtual function table.
*/
newStorage->base.lpVtbl = &Storage32InternalImpl_Vtbl;
+ newStorage->base.pssVtbl = &IPropertySetStorage_Vtbl;
newStorage->base.baseVtbl = &StorageInternalImpl_BaseVtbl;
newStorage->base.openFlags = (openFlags & ~STGM_CREATE);
@@ -5710,7 +5730,7 @@
ULARGE_INTEGER offsetOfBlockInDepot;
DWORD buffer;
ULONG bytesRead;
- ULONG blockIndex = 0;
+ ULONG blockIndex = This->parentStorage->firstFreeSmallBlock;
ULONG nextBlockIndex = BLOCK_END_OF_CHAIN;
HRESULT res = S_OK;
ULONG smallBlocksPerBigBlock;
@@ -5818,6 +5838,8 @@
StorageImpl_SaveFileHeader(This->parentStorage);
}
}
+
+ This->parentStorage->firstFreeSmallBlock = blockIndex+1;
smallBlocksPerBigBlock =
This->parentStorage->bigBlockSize / This->parentStorage->smallBlockSize;
@@ -6117,6 +6139,7 @@
&blockIndex)))
return FALSE;
SmallBlockChainStream_FreeBlock(This, extraBlock);
+ This->parentStorage->firstFreeSmallBlock =
min(This->parentStorage->firstFreeSmallBlock, extraBlock);
extraBlock = blockIndex;
}
@@ -6291,6 +6314,146 @@
&chainEntry);
return chainEntry.size;
+}
+
+static HRESULT create_storagefile(
+ LPCOLESTR pwcsName,
+ DWORD grfMode,
+ DWORD grfAttrs,
+ STGOPTIONS* pStgOptions,
+ REFIID riid,
+ void** ppstgOpen)
+{
+ StorageBaseImpl* newStorage = 0;
+ HANDLE hFile = INVALID_HANDLE_VALUE;
+ HRESULT hr = STG_E_INVALIDFLAG;
+ DWORD shareMode;
+ DWORD accessMode;
+ DWORD creationMode;
+ DWORD fileAttributes;
+ WCHAR tempFileName[MAX_PATH];
+
+ if (ppstgOpen == 0)
+ return STG_E_INVALIDPOINTER;
+
+ if (pStgOptions->ulSectorSize != MIN_BIG_BLOCK_SIZE &&
pStgOptions->ulSectorSize != MAX_BIG_BLOCK_SIZE)
+ return STG_E_INVALIDPARAMETER;
+
+ /* if no share mode given then DENY_NONE is the default */
+ if (STGM_SHARE_MODE(grfMode) == 0)
+ grfMode |= STGM_SHARE_DENY_NONE;
+
+ if ( FAILED( validateSTGM(grfMode) ))
+ goto end;
+
+ /* StgCreateDocFile seems to refuse readonly access, despite MSDN */
+ switch(STGM_ACCESS_MODE(grfMode))
+ {
+ case STGM_WRITE:
+ case STGM_READWRITE:
+ break;
+ default:
+ goto end;
+ }
+
+ /* in direct mode, can only use SHARE_EXCLUSIVE */
+ if (!(grfMode & STGM_TRANSACTED) && (STGM_SHARE_MODE(grfMode) !=
STGM_SHARE_EXCLUSIVE))
+ goto end;
+
+ /* but in transacted mode, any share mode is valid */
+
+ /*
+ * Generate a unique name.
+ */
+ if (pwcsName == 0)
+ {
+ WCHAR tempPath[MAX_PATH];
+ static const WCHAR prefix[] = { 'S', 'T', 'O', 0 };
+
+ memset(tempPath, 0, sizeof(tempPath));
+ memset(tempFileName, 0, sizeof(tempFileName));
+
+ if ((GetTempPathW(MAX_PATH, tempPath)) == 0 )
+ tempPath[0] = '.';
+
+ if (GetTempFileNameW(tempPath, prefix, 0, tempFileName) != 0)
+ pwcsName = tempFileName;
+ else
+ {
+ hr = STG_E_INSUFFICIENTMEMORY;
+ goto end;
+ }
+
+ creationMode = TRUNCATE_EXISTING;
+ }
+ else
+ {
+ creationMode = GetCreationModeFromSTGM(grfMode);
+ }
+
+ /*
+ * Interpret the STGM value grfMode
+ */
+ shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
+ accessMode = GetAccessModeFromSTGM(grfMode);
+
+ if (grfMode & STGM_DELETEONRELEASE)
+ fileAttributes = FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_DELETE_ON_CLOSE;
+ else
+ fileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS;
+
+ if (STGM_SHARE_MODE(grfMode) && !(grfMode & STGM_SHARE_DENY_NONE))
+ {
+ static int fixme;
+ if (!fixme++)
+ FIXME("Storage share mode not implemented.\n");
+ }
+
+ *ppstgOpen = 0;
+
+ hFile = CreateFileW(pwcsName,
+ accessMode,
+ shareMode,
+ NULL,
+ creationMode,
+ fileAttributes,
+ 0);
+
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ if(GetLastError() == ERROR_FILE_EXISTS)
+ hr = STG_E_FILEALREADYEXISTS;
+ else
+ hr = E_FAIL;
+ goto end;
+ }
+
+ /*
+ * Allocate and initialize the new IStorage32object.
+ */
+ hr = Storage_Construct(
+ hFile,
+ pwcsName,
+ NULL,
+ grfMode,
+ TRUE,
+ TRUE,
+ pStgOptions->ulSectorSize,
+ &newStorage);
+
+ if (FAILED(hr))
+ {
+ goto end;
+ }
+
+ hr = IStorage_QueryInterface((IStorage*)newStorage, riid, ppstgOpen);
+
+ IStorage_Release((IStorage*)newStorage);
+
+end:
+ TRACE("<-- %p r = %08x\n", *ppstgOpen, hr);
+
+ return hr;
}
/******************************************************************************
@@ -6318,14 +6481,7 @@
DWORD reserved,
IStorage **ppstgOpen)
{
- StorageBaseImpl* newStorage = 0;
- HANDLE hFile = INVALID_HANDLE_VALUE;
- HRESULT hr = STG_E_INVALIDFLAG;
- DWORD shareMode;
- DWORD accessMode;
- DWORD creationMode;
- DWORD fileAttributes;
- WCHAR tempFileName[MAX_PATH];
+ STGOPTIONS stgoptions = {1, 0, 512};
TRACE("(%s, %x, %d, %p)\n",
debugstr_w(pwcsName), grfMode,
@@ -6336,121 +6492,7 @@
if (reserved != 0)
return STG_E_INVALIDPARAMETER;
- /* if no share mode given then DENY_NONE is the default */
- if (STGM_SHARE_MODE(grfMode) == 0)
- grfMode |= STGM_SHARE_DENY_NONE;
-
- if ( FAILED( validateSTGM(grfMode) ))
- goto end;
-
- /* StgCreateDocFile seems to refuse readonly access, despite MSDN */
- switch(STGM_ACCESS_MODE(grfMode))
- {
- case STGM_WRITE:
- case STGM_READWRITE:
- break;
- default:
- goto end;
- }
-
- /* in direct mode, can only use SHARE_EXCLUSIVE */
- if (!(grfMode & STGM_TRANSACTED) && (STGM_SHARE_MODE(grfMode) !=
STGM_SHARE_EXCLUSIVE))
- goto end;
-
- /* but in transacted mode, any share mode is valid */
-
- /*
- * Generate a unique name.
- */
- if (pwcsName == 0)
- {
- WCHAR tempPath[MAX_PATH];
- static const WCHAR prefix[] = { 'S', 'T', 'O', 0 };
-
- memset(tempPath, 0, sizeof(tempPath));
- memset(tempFileName, 0, sizeof(tempFileName));
-
- if ((GetTempPathW(MAX_PATH, tempPath)) == 0 )
- tempPath[0] = '.';
-
- if (GetTempFileNameW(tempPath, prefix, 0, tempFileName) != 0)
- pwcsName = tempFileName;
- else
- {
- hr = STG_E_INSUFFICIENTMEMORY;
- goto end;
- }
-
- creationMode = TRUNCATE_EXISTING;
- }
- else
- {
- creationMode = GetCreationModeFromSTGM(grfMode);
- }
-
- /*
- * Interpret the STGM value grfMode
- */
- shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
- accessMode = GetAccessModeFromSTGM(grfMode);
-
- if (grfMode & STGM_DELETEONRELEASE)
- fileAttributes = FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_DELETE_ON_CLOSE;
- else
- fileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS;
-
- if (STGM_SHARE_MODE(grfMode) && !(grfMode & STGM_SHARE_DENY_NONE))
- {
- static int fixme;
- if (!fixme++)
- FIXME("Storage share mode not implemented.\n");
- }
-
- *ppstgOpen = 0;
-
- hFile = CreateFileW(pwcsName,
- accessMode,
- shareMode,
- NULL,
- creationMode,
- fileAttributes,
- 0);
-
- if (hFile == INVALID_HANDLE_VALUE)
- {
- if(GetLastError() == ERROR_FILE_EXISTS)
- hr = STG_E_FILEALREADYEXISTS;
- else
- hr = E_FAIL;
- goto end;
- }
-
- /*
- * Allocate and initialize the new IStorage32object.
- */
- hr = Storage_Construct(
- hFile,
- pwcsName,
- NULL,
- grfMode,
- TRUE,
- TRUE,
- &newStorage);
-
- if (FAILED(hr))
- {
- goto end;
- }
-
- /*
- * Get an "out" pointer for the caller.
- */
- *ppstgOpen = (IStorage*)newStorage;
-
-end:
- TRACE("<-- %p r = %08x\n", *ppstgOpen, hr);
-
- return hr;
+ return create_storagefile(pwcsName, grfMode, 0, &stgoptions, &IID_IStorage,
(void**)ppstgOpen);
}
/******************************************************************************
@@ -6481,9 +6523,9 @@
if (stgfmt == STGFMT_STORAGE || stgfmt == STGFMT_DOCFILE)
{
- FIXME("Stub: calling StgCreateDocfile, but ignoring pStgOptions and
grfAttrs\n");
- return StgCreateDocfile(pwcsName, grfMode, 0, (IStorage **)ppObjectOpen);
- }
+ return create_storagefile(pwcsName, grfMode, grfAttrs, pStgOptions, riid,
ppObjectOpen);
+ }
+
ERR("Invalid stgfmt argument\n");
return STG_E_INVALIDPARAMETER;
@@ -6707,6 +6749,7 @@
grfMode,
TRUE,
FALSE,
+ 512,
&newStorage);
if (FAILED(hr))
@@ -6754,6 +6797,7 @@
grfMode,
FALSE,
TRUE,
+ 512,
&newStorage);
if (FAILED(hr))
@@ -6801,6 +6845,7 @@
grfMode,
FALSE,
FALSE,
+ 512,
&newStorage);
if (FAILED(hr))
Modified: trunk/reactos/dll/win32/ole32/storage32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
==============================================================================
--- trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -46,6 +46,7 @@
static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020;
static const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C;
static const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030;
+static const ULONG OFFSET_SMALLBLOCKLIMIT = 0x00000038;
static const ULONG OFFSET_SBDEPOTSTART = 0x0000003C;
static const ULONG OFFSET_SBDEPOTCOUNT = 0x00000040;
static const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044;
@@ -65,6 +66,8 @@
static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074;
static const ULONG OFFSET_PS_SIZE = 0x00000078;
static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009;
+static const WORD MIN_BIG_BLOCK_SIZE_BITS = 0x0009;
+static const WORD MAX_BIG_BLOCK_SIZE_BITS = 0x000c;
static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006;
static const WORD DEF_BIG_BLOCK_SIZE = 0x0200;
static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040;
@@ -97,6 +100,8 @@
#define STGTY_ROOT 0x05
#define COUNT_BBDEPOTINHEADER 109
+
+/* FIXME: This value is stored in the header, but we hard-code it to 0x1000. */
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
#define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f)
@@ -351,6 +356,7 @@
ULONG smallBlockSize;
ULONG bigBlockDepotCount;
ULONG rootStartBlock;
+ ULONG smallBlockLimit;
ULONG smallBlockDepotStart;
ULONG extBigBlockDepotStart;
ULONG extBigBlockDepotCount;
@@ -359,6 +365,9 @@
ULONG blockDepotCached[MAX_BIG_BLOCK_SIZE / 4];
ULONG indexBlockDepotCached;
ULONG prevFreeBlock;
+
+ /* All small blocks before this one are known to be in use. */
+ ULONG firstFreeSmallBlock;
/*
* Abstraction of the big block chains for the chains of the header.
Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepict…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -1273,7 +1273,7 @@
static HRESULT OLEPictureImpl_LoadAPM(OLEPictureImpl *This,
const BYTE *data, ULONG size)
{
- APM_HEADER *header = (APM_HEADER *)data;
+ const APM_HEADER *header = (const APM_HEADER *)data;
HMETAFILE hmf;
if (size < sizeof(APM_HEADER))
Modified: trunk/reactos/dll/win32/oleaut32/regsvr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/regsvr.…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/regsvr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/regsvr.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -480,6 +480,12 @@
"Obsolete Font",
"OldFont"
},
+ { &IID_ISupportErrorInfo,
+ "PSSupportErrorInfo",
+ "ole2disp.dll",
+ "oleaut32.dll",
+ NULL
+ },
{ NULL } /* list terminator */
};
Modified: trunk/reactos/dll/win32/oleaut32/typelib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -283,30 +283,9 @@
static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath,
ITypeLib2 **ppTypeLib);
-/****************************************************************************
- * QueryPathOfRegTypeLib [OLEAUT32.164]
- *
- * Gets the path to a registered type library.
- *
- * PARAMS
- * guid [I] referenced guid
- * wMaj [I] major version
- * wMin [I] minor version
- * lcid [I] locale id
- * path [O] path of typelib
- *
- * RETURNS
- * Success: S_OK.
- * Failure: If the type library is not registered then TYPE_E_LIBNOTREGISTERED
- * or TYPE_E_REGISTRYACCESS if the type library registration key couldn't be
- * opened.
- */
-HRESULT WINAPI QueryPathOfRegTypeLib(
- REFGUID guid,
- WORD wMaj,
- WORD wMin,
- LCID lcid,
- LPBSTR path )
+/* Get the path to a registered type library. Helper for QueryPathOfRegTypeLib. */
+static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin,
+ SYSKIND syskind, LCID lcid, LPBSTR path )
{
HRESULT hr = TYPE_E_LIBNOTREGISTERED;
LCID myLCID = lcid;
@@ -336,7 +315,7 @@
{
LONG dwPathLen = sizeof(Path);
- get_lcid_subkey( myLCID, SYS_WIN32, buffer );
+ get_lcid_subkey( myLCID, syskind, buffer );
if (RegQueryValueW(hkey, buffer, Path, &dwPathLen))
{
@@ -366,6 +345,29 @@
RegCloseKey( hkey );
TRACE_(typelib)("-- 0x%08x\n", hr);
return hr;
+}
+
+/****************************************************************************
+ * QueryPathOfRegTypeLib [OLEAUT32.164]
+ *
+ * Gets the path to a registered type library.
+ *
+ * PARAMS
+ * guid [I] referenced guid
+ * wMaj [I] major version
+ * wMin [I] minor version
+ * lcid [I] locale id
+ * path [O] path of typelib
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: If the type library is not registered then TYPE_E_LIBNOTREGISTERED
+ * or TYPE_E_REGISTRYACCESS if the type library registration key couldn't be
+ * opened.
+ */
+HRESULT WINAPI QueryPathOfRegTypeLib( REFGUID guid, WORD wMaj, WORD wMin, LCID lcid,
LPBSTR path )
+{
+ return query_typelib_path( guid, wMaj, wMin, SYS_WIN32, lcid, path );
}
/******************************************************************************
@@ -691,7 +693,10 @@
MESSAGE("\n");
}
- if (tattr->wTypeFlags &
(TYPEFLAG_FOLEAUTOMATION|TYPEFLAG_FDUAL|TYPEFLAG_FDISPATCHABLE))
+ /* Register all dispinterfaces (which includes dual interfaces) and
+ oleautomation interfaces */
+ if ((kind == TKIND_INTERFACE && (tattr->wTypeFlags &
TYPEFLAG_FOLEAUTOMATION)) ||
+ kind == TKIND_DISPATCH)
{
/* register interface<->typelib coupling */
get_interface_key( &tattr->guid, keyName );
@@ -796,7 +801,7 @@
}
/* get the path to the typelib on disk */
- if (QueryPathOfRegTypeLib(libid, wVerMajor, wVerMinor, lcid, &tlibPath) != S_OK)
{
+ if (query_typelib_path(libid, wVerMajor, wVerMinor, syskind, lcid, &tlibPath) !=
S_OK) {
result = E_INVALIDARG;
goto end;
}
@@ -832,19 +837,23 @@
goto enddeleteloop;
}
- /* the path to the type */
- get_interface_key( &typeAttr->guid, subKeyName );
-
- /* Delete its bits */
- if (RegOpenKeyExW(HKEY_CLASSES_ROOT, subKeyName, 0, KEY_WRITE, &subKey) !=
ERROR_SUCCESS) {
- goto enddeleteloop;
- }
- RegDeleteKeyW(subKey, ProxyStubClsidW);
- RegDeleteKeyW(subKey, ProxyStubClsid32W);
- RegDeleteKeyW(subKey, TypeLibW);
- RegCloseKey(subKey);
- subKey = NULL;
- RegDeleteKeyW(HKEY_CLASSES_ROOT, subKeyName);
+ if ((kind == TKIND_INTERFACE && (typeAttr->wTypeFlags &
TYPEFLAG_FOLEAUTOMATION)) ||
+ kind == TKIND_DISPATCH)
+ {
+ /* the path to the type */
+ get_interface_key( &typeAttr->guid, subKeyName );
+
+ /* Delete its bits */
+ if (RegOpenKeyExW(HKEY_CLASSES_ROOT, subKeyName, 0, KEY_WRITE, &subKey)
!= ERROR_SUCCESS)
+ goto enddeleteloop;
+
+ RegDeleteKeyW(subKey, ProxyStubClsidW);
+ RegDeleteKeyW(subKey, ProxyStubClsid32W);
+ RegDeleteKeyW(subKey, TypeLibW);
+ RegCloseKey(subKey);
+ subKey = NULL;
+ RegDeleteKeyW(HKEY_CLASSES_ROOT, subKeyName);
+ }
enddeleteloop:
if (typeAttr) ITypeInfo_ReleaseTypeAttr(typeInfo, typeAttr);
@@ -1901,7 +1910,7 @@
{
if (!IS_INTRESOURCE(pFuncRec->OptAttr[2]))
ERR("ordinal 0x%08x invalid, IS_INTRESOURCE is
false\n", pFuncRec->OptAttr[2]);
- (*pptfd)->Entry = (BSTR)pFuncRec->OptAttr[2];
+ (*pptfd)->Entry =
(BSTR)(DWORD_PTR)LOWORD(pFuncRec->OptAttr[2]);
}
else
{
@@ -2927,7 +2936,7 @@
else if(td[0] == VT_CARRAY)
{
/* array descr table here */
- pTypeLibImpl->pTypeDesc[i].u.lpadesc = (void *)((int) td[2]); /* temp store
offset in*/
+ pTypeLibImpl->pTypeDesc[i].u.lpadesc = (void *)(INT_PTR)td[2]; /* temp store
offset in*/
}
else if(td[0] == VT_USERDEFINED)
{
@@ -2942,7 +2951,7 @@
if(pTypeLibImpl->pTypeDesc[i].vt != VT_CARRAY) continue;
if(tlbSegDir.pArrayDescriptions.offset>0)
{
- MSFT_ReadLEWords(td, sizeof(td), &cx,
tlbSegDir.pArrayDescriptions.offset + (int) pTypeLibImpl->pTypeDesc[i].u.lpadesc);
+ MSFT_ReadLEWords(td, sizeof(td), &cx,
tlbSegDir.pArrayDescriptions.offset + (INT_PTR)pTypeLibImpl->pTypeDesc[i].u.lpadesc);
pTypeLibImpl->pTypeDesc[i].u.lpadesc =
TLB_Alloc(sizeof(ARRAYDESC)+sizeof(SAFEARRAYBOUND)*(td[3]-1));
if(td[1]<0)
@@ -4779,13 +4788,7 @@
&subtypeinfo, &subdesckind, &subbindptr);
if (SUCCEEDED(hr) && (subdesckind != DESCKIND_NONE))
{
- TYPEDESC tdesc_appobject =
- {
- {
- (TYPEDESC *)pTypeInfo->hreftype
- },
- VT_USERDEFINED
- };
+ TYPEDESC tdesc_appobject;
const VARDESC vardesc_appobject =
{
-2, /* memid */
@@ -4806,6 +4809,9 @@
0, /* wVarFlags */
VAR_STATIC /* varkind */
};
+
+ tdesc_appobject.u.hreftype = pTypeInfo->hreftype;
+ tdesc_appobject.vt = VT_USERDEFINED;
TRACE("found in implicit app object: %s\n",
debugstr_w(szName));
@@ -5696,7 +5702,8 @@
if (TRACE_ON(ole)) {
int i;
TRACE("Calling %p(",func);
- for (i=0;i<nrargs;i++) TRACE("%08x,",args[i]);
+ for (i=0;i<min(nrargs,30);i++) TRACE("%08x,",args[i]);
+ if (nrargs > 30) TRACE("...");
TRACE(")\n");
}
@@ -6102,10 +6109,11 @@
continue;
}
+ src_arg = NULL;
+
if (cNamedArgs)
{
USHORT j;
- src_arg = NULL;
for (j = 0; j < cNamedArgs; j++)
if (rgdispidNamedArgs[j] == i || (i == func_desc->cParams-1
&& rgdispidNamedArgs[j] == DISPID_PROPERTYPUT))
{
@@ -6113,9 +6121,10 @@
break;
}
}
- else
+
+ if (!src_arg && vargs_converted + cNamedArgs <
pDispParams->cArgs)
{
- src_arg = vargs_converted < pDispParams->cArgs ?
&pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted] : NULL;
+ src_arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 -
vargs_converted];
vargs_converted++;
}
@@ -6596,7 +6605,7 @@
if (pBstrName)
*pBstrName = NULL;
if (pwOrdinal)
- *pwOrdinal = (DWORD)pFDesc->Entry;
+ *pwOrdinal = LOWORD(pFDesc->Entry);
return S_OK;
}
return TYPE_E_ELEMENTNOTFOUND;
Modified: trunk/reactos/dll/win32/oleaut32/typelib2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -2456,7 +2456,7 @@
return hres;
}
- This->typeinfo->cbSizeVft = typeattr->cbSizeVft;
+ This->typeinfo->cbSizeVft = typeattr->cbSizeVft * 4 / sizeof(void *);
ITypeInfo_ReleaseTypeAttr(inherited, typeattr);
ITypeInfo_Release(inherited);
@@ -2928,7 +2928,7 @@
(*ppTypeAttr)->cFuncs += 7;
(*ppTypeAttr)->cVars = This->typeinfo->cElement>>16;
(*ppTypeAttr)->cImplTypes = This->typeinfo->cImplTypes;
- (*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 28 :
This->typeinfo->cbSizeVft;
+ (*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 7 * sizeof(void*) :
This->typeinfo->cbSizeVft;
(*ppTypeAttr)->cbAlignment = (This->typeinfo->typekind>>11) &
0x1f;
(*ppTypeAttr)->wTypeFlags = This->typeinfo->flags;
(*ppTypeAttr)->wMajorVerNum = This->typeinfo->version&0xffff;
Modified: trunk/reactos/dll/win32/oleaut32/vartype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -3503,7 +3503,7 @@
*/
HRESULT WINAPI VarCyFromR8(double dblIn, CY* pCyOut)
{
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
/* This code gives identical results to Win32 on Intel.
* Here we use fp exceptions to catch overflows when storing the value.
*/
Modified: trunk/reactos/include/psdk/winbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Tue Apr 20 19:36:44 2010
@@ -2301,6 +2301,9 @@
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE);
#endif
BOOL WINAPI WinLoadTrustProvider(GUID*);
+BOOL WINAPI Wow64DisableWow64FsRedirection(PVOID*);
+BOOLEAN WINAPI Wow64EnableWow64FsRedirection(BOOLEAN);
+BOOL WINAPI Wow64RevertWow64FsRedirection(PVOID);
BOOL WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
BOOL WINAPI
WriteFileEx(HANDLE,LPCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
BOOL WINAPI WriteFileGather(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED);