* Sync with Wine 1.5.26.

svn path=/trunk/; revision=58586
This commit is contained in:
Amine Khaldi 2013-03-23 10:35:27 +00:00
parent 43fd991656
commit 5d0dc7b588
10 changed files with 173 additions and 173 deletions

View file

@ -818,14 +818,17 @@ static void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay)
real_delay = 0; real_delay = 0;
} }
if (!real_delay || (entry->unload_time && (entry->unload_time < GetTickCount()))) if (!real_delay || (entry->unload_time && ((int)(GetTickCount() - entry->unload_time) > 0)))
{ {
list_remove(&entry->entry); list_remove(&entry->entry);
COMPOBJ_DllList_ReleaseRef(entry->dll, TRUE); COMPOBJ_DllList_ReleaseRef(entry->dll, TRUE);
HeapFree(GetProcessHeap(), 0, entry); HeapFree(GetProcessHeap(), 0, entry);
} }
else else
{
entry->unload_time = GetTickCount() + real_delay; entry->unload_time = GetTickCount() + real_delay;
if (!entry->unload_time) entry->unload_time = 1;
}
} }
else if (entry->unload_time) else if (entry->unload_time)
entry->unload_time = 0; entry->unload_time = 0;
@ -2035,8 +2038,11 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
*ppszProgID = CoTaskMemAlloc(progidlen * sizeof(WCHAR)); *ppszProgID = CoTaskMemAlloc(progidlen * sizeof(WCHAR));
if (*ppszProgID) if (*ppszProgID)
{ {
if (RegQueryValueW(hkey, NULL, *ppszProgID, &progidlen)) if (RegQueryValueW(hkey, NULL, *ppszProgID, &progidlen)) {
ret = REGDB_E_CLASSNOTREG; ret = REGDB_E_CLASSNOTREG;
CoTaskMemFree(*ppszProgID);
*ppszProgID = NULL;
}
} }
else else
ret = E_OUTOFMEMORY; ret = E_OUTOFMEMORY;
@ -2745,15 +2751,9 @@ HRESULT WINAPI CoCreateInstance(
TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid), TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid),
pUnkOuter, dwClsContext, debugstr_guid(iid), ppv); pUnkOuter, dwClsContext, debugstr_guid(iid), ppv);
/*
* Sanity check
*/
if (ppv==0) if (ppv==0)
return E_POINTER; return E_POINTER;
/*
* Initialize the "out" parameter
*/
*ppv = 0; *ppv = 0;
if (!(apt = COM_CurrentApt())) if (!(apt = COM_CurrentApt()))
@ -2770,10 +2770,13 @@ HRESULT WINAPI CoCreateInstance(
* The Standard Global Interface Table (GIT) object is a process-wide singleton. * The Standard Global Interface Table (GIT) object is a process-wide singleton.
* Rather than create a class factory, we can just check for it here * Rather than create a class factory, we can just check for it here
*/ */
if (IsEqualIID(rclsid, &CLSID_StdGlobalInterfaceTable)) { if (IsEqualIID(rclsid, &CLSID_StdGlobalInterfaceTable))
{
if (StdGlobalInterfaceTableInstance == NULL) if (StdGlobalInterfaceTableInstance == NULL)
StdGlobalInterfaceTableInstance = StdGlobalInterfaceTable_Construct(); StdGlobalInterfaceTableInstance = StdGlobalInterfaceTable_Construct();
hres = IGlobalInterfaceTable_QueryInterface( (IGlobalInterfaceTable*) StdGlobalInterfaceTableInstance, iid, ppv); hres = IGlobalInterfaceTable_QueryInterface((IGlobalInterfaceTable*)StdGlobalInterfaceTableInstance,
iid,
ppv);
if (hres) return hres; if (hres) return hres;
TRACE("Retrieved GIT (%p)\n", *ppv); TRACE("Retrieved GIT (%p)\n", *ppv);
@ -2805,7 +2808,9 @@ HRESULT WINAPI CoCreateInstance(
if (hres == CLASS_E_NOAGGREGATION && pUnkOuter) if (hres == CLASS_E_NOAGGREGATION && pUnkOuter)
FIXME("Class %s does not support aggregation\n", debugstr_guid(rclsid)); FIXME("Class %s does not support aggregation\n", debugstr_guid(rclsid));
else else
FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n", debugstr_guid(iid), debugstr_guid(rclsid),hres); FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n",
debugstr_guid(iid),
debugstr_guid(rclsid),hres);
} }
return hres; return hres;
@ -3876,6 +3881,7 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
if (res == WAIT_OBJECT_0 + cHandles) /* messages available */ if (res == WAIT_OBJECT_0 + cHandles) /* messages available */
{ {
MSG msg; MSG msg;
int count = 0;
/* call message filter */ /* call message filter */
@ -3905,7 +3911,9 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
} }
} }
while (COM_PeekMessage(apt, &msg)) /* 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))
{ {
TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message); TRACE("received message whilst waiting for RPC: 0x%04x\n", msg.message);
TranslateMessage(&msg); TranslateMessage(&msg);

View file

@ -1641,10 +1641,10 @@ static const IEnumMonikerVtbl VT_EnumMonikerImpl =
******************************************************************************/ ******************************************************************************/
static HRESULT static HRESULT
EnumMonikerImpl_CreateEnumMoniker(IMoniker** tabMoniker, ULONG tabSize, EnumMonikerImpl_CreateEnumMoniker(IMoniker** tabMoniker, ULONG tabSize,
ULONG currentPos, BOOL leftToRigth, IEnumMoniker ** ppmk) ULONG currentPos, BOOL leftToRight, IEnumMoniker ** ppmk)
{ {
EnumMonikerImpl* newEnumMoniker; EnumMonikerImpl* newEnumMoniker;
int i; ULONG i;
if (currentPos > tabSize) if (currentPos > tabSize)
return E_INVALIDARG; return E_INVALIDARG;
@ -1668,17 +1668,17 @@ EnumMonikerImpl_CreateEnumMoniker(IMoniker** tabMoniker, ULONG tabSize,
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
if (leftToRigth) if (leftToRight)
for (i=0;i<tabSize;i++){ for (i=0;i<tabSize;i++){
newEnumMoniker->tabMoniker[i]=tabMoniker[i]; newEnumMoniker->tabMoniker[i]=tabMoniker[i];
IMoniker_AddRef(tabMoniker[i]); IMoniker_AddRef(tabMoniker[i]);
} }
else else
for (i=tabSize-1;i>=0;i--){ for (i = tabSize; i > 0; i--){
newEnumMoniker->tabMoniker[tabSize-i-1]=tabMoniker[i]; newEnumMoniker->tabMoniker[tabSize-i]=tabMoniker[i - 1];
IMoniker_AddRef(tabMoniker[i]); IMoniker_AddRef(tabMoniker[i - 1]);
} }
*ppmk=&newEnumMoniker->IEnumMoniker_iface; *ppmk=&newEnumMoniker->IEnumMoniker_iface;

View file

@ -1325,7 +1325,7 @@ static HRESULT WINAPI DefaultHandler_Run(
release_delegates(This); release_delegates(This);
hr = CoCreateInstance(&This->clsid, NULL, CLSCTX_ALL, hr = CoCreateInstance(&This->clsid, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
&IID_IOleObject, (void **)&This->pOleDelegate); &IID_IOleObject, (void **)&This->pOleDelegate);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;

View file

@ -149,7 +149,7 @@ static BOOL start_rpcss(void)
strcatW( cmd, rpcss ); strcatW( cmd, rpcss );
Wow64DisableWow64FsRedirection( &redir ); Wow64DisableWow64FsRedirection( &redir );
rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi );
Wow64RevertWow64FsRedirection( redir ); Wow64RevertWow64FsRedirection( redir );
if (rslt) if (rslt)

View file

@ -1940,7 +1940,8 @@ HRESULT WINAPI OleSetMenuDescriptor(
/* If OLEMenu hooks are already installed for this thread, fail /* If OLEMenu hooks are already installed for this thread, fail
* Note: This effectively means that OleSetMenuDescriptor cannot * Note: This effectively means that OleSetMenuDescriptor cannot
* be called twice in succession on the same frame window * be called twice in succession on the same frame window
* without first calling it with a null hOleMenu to uninstall */ * without first calling it with a null hOleMenu to uninstall
*/
if ( OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) if ( OLEMenu_IsHookInstalled( GetCurrentThreadId() ) )
return E_FAIL; return E_FAIL;

View file

@ -1683,7 +1683,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
/* FIXME: Win2003 supports a ServerExecutable value that is passed into /* FIXME: Win2003 supports a ServerExecutable value that is passed into
* CreateProcess */ * CreateProcess */
if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &sinfo, &pinfo)) { if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &sinfo, &pinfo)) {
WARN("failed to run local server %s\n", debugstr_w(command)); WARN("failed to run local server %s\n", debugstr_w(command));
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
@ -1880,7 +1880,7 @@ struct local_server_params
{ {
CLSID clsid; CLSID clsid;
IStream *stream; IStream *stream;
HANDLE ready_event; HANDLE pipe;
HANDLE stop_event; HANDLE stop_event;
HANDLE thread; HANDLE thread;
BOOL multi_use; BOOL multi_use;
@ -1901,7 +1901,7 @@ static DWORD WINAPI local_server_thread(LPVOID param)
ULONG res; ULONG res;
BOOL multi_use = lsp->multi_use; BOOL multi_use = lsp->multi_use;
OVERLAPPED ovl; OVERLAPPED ovl;
HANDLE pipe_event, hPipe, new_pipe; HANDLE pipe_event, hPipe = lsp->pipe, new_pipe;
DWORD bytes; DWORD bytes;
TRACE("Starting threader for %s.\n",debugstr_guid(&lsp->clsid)); TRACE("Starting threader for %s.\n",debugstr_guid(&lsp->clsid));
@ -1910,18 +1910,6 @@ static DWORD WINAPI local_server_thread(LPVOID param)
get_localserver_pipe_name(pipefn, &lsp->clsid); get_localserver_pipe_name(pipefn, &lsp->clsid);
ovl.hEvent = pipe_event = CreateEventW(NULL, FALSE, FALSE, NULL); ovl.hEvent = pipe_event = CreateEventW(NULL, FALSE, FALSE, NULL);
hPipe = CreateNamedPipeW( pipefn, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE|PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
4096, 4096, 500 /* 0.5 second timeout */, NULL );
if (hPipe == INVALID_HANDLE_VALUE)
{
FIXME("pipe creation failed for %s, le is %u\n", debugstr_w(pipefn), GetLastError());
CloseHandle(pipe_event);
return 1;
}
SetEvent(lsp->ready_event);
while (1) { while (1) {
if (!ConnectNamedPipe(hPipe, &ovl)) if (!ConnectNamedPipe(hPipe, &ovl))
{ {
@ -2011,8 +1999,9 @@ static DWORD WINAPI local_server_thread(LPVOID param)
/* starts listening for a local server */ /* starts listening for a local server */
HRESULT RPC_StartLocalServer(REFCLSID clsid, IStream *stream, BOOL multi_use, void **registration) HRESULT RPC_StartLocalServer(REFCLSID clsid, IStream *stream, BOOL multi_use, void **registration)
{ {
DWORD tid; DWORD tid, err;
struct local_server_params *lsp; struct local_server_params *lsp;
WCHAR pipefn[100];
lsp = HeapAlloc(GetProcessHeap(), 0, sizeof(*lsp)); lsp = HeapAlloc(GetProcessHeap(), 0, sizeof(*lsp));
if (!lsp) if (!lsp)
@ -2021,34 +2010,36 @@ HRESULT RPC_StartLocalServer(REFCLSID clsid, IStream *stream, BOOL multi_use, vo
lsp->clsid = *clsid; lsp->clsid = *clsid;
lsp->stream = stream; lsp->stream = stream;
IStream_AddRef(stream); IStream_AddRef(stream);
lsp->ready_event = CreateEventW(NULL, FALSE, FALSE, NULL);
if (!lsp->ready_event)
{
HeapFree(GetProcessHeap(), 0, lsp);
return HRESULT_FROM_WIN32(GetLastError());
}
lsp->stop_event = CreateEventW(NULL, FALSE, FALSE, NULL); lsp->stop_event = CreateEventW(NULL, FALSE, FALSE, NULL);
if (!lsp->stop_event) if (!lsp->stop_event)
{ {
CloseHandle(lsp->ready_event);
HeapFree(GetProcessHeap(), 0, lsp); HeapFree(GetProcessHeap(), 0, lsp);
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
lsp->multi_use = multi_use; lsp->multi_use = multi_use;
get_localserver_pipe_name(pipefn, &lsp->clsid);
lsp->pipe = CreateNamedPipeW(pipefn, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE|PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
4096, 4096, 500 /* 0.5 second timeout */, NULL);
if (lsp->pipe == INVALID_HANDLE_VALUE)
{
err = GetLastError();
FIXME("pipe creation failed for %s, le is %u\n", debugstr_w(pipefn), GetLastError());
CloseHandle(lsp->stop_event);
HeapFree(GetProcessHeap(), 0, lsp);
return HRESULT_FROM_WIN32(err);
}
lsp->thread = CreateThread(NULL, 0, local_server_thread, lsp, 0, &tid); lsp->thread = CreateThread(NULL, 0, local_server_thread, lsp, 0, &tid);
if (!lsp->thread) if (!lsp->thread)
{ {
CloseHandle(lsp->ready_event); CloseHandle(lsp->pipe);
CloseHandle(lsp->stop_event); CloseHandle(lsp->stop_event);
HeapFree(GetProcessHeap(), 0, lsp); HeapFree(GetProcessHeap(), 0, lsp);
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
WaitForSingleObject(lsp->ready_event, INFINITE);
CloseHandle(lsp->ready_event);
lsp->ready_event = NULL;
*registration = lsp; *registration = lsp;
return S_OK; return S_OK;
} }

View file

@ -1767,7 +1767,7 @@ static HRESULT WINAPI StorageBaseImpl_CopyTo(
StorageBaseImpl *This = impl_from_IStorage(iface); StorageBaseImpl *This = impl_from_IStorage(iface);
BOOL skip_storage = FALSE, skip_stream = FALSE; BOOL skip_storage = FALSE, skip_stream = FALSE;
int i; DWORD i;
TRACE("(%p, %d, %p, %p, %p)\n", TRACE("(%p, %d, %p, %p, %p)\n",
iface, ciidExclude, rgiidExclude, iface, ciidExclude, rgiidExclude,
@ -2822,7 +2822,7 @@ static HRESULT StorageImpl_Construct(
{ {
ULONG current_block = This->extBigBlockDepotStart; ULONG current_block = This->extBigBlockDepotStart;
ULONG cache_size = This->extBigBlockDepotCount * 2; ULONG cache_size = This->extBigBlockDepotCount * 2;
int i; ULONG i;
This->extBigBlockDepotLocations = HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG) * cache_size); This->extBigBlockDepotLocations = HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG) * cache_size);
if (!This->extBigBlockDepotLocations) if (!This->extBigBlockDepotLocations)

View file

@ -2360,8 +2360,8 @@ HRESULT CALLBACK IMoniker_BindToStorage_Proxy(
REFIID riid, REFIID riid,
void **ppvObj) void **ppvObj)
{ {
FIXME(":stub\n"); TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObj);
return E_NOTIMPL; return IMoniker_RemoteBindToStorage_Proxy(This, pbc, pmkToLeft, riid, (IUnknown**)ppvObj);
} }
HRESULT __RPC_STUB IMoniker_BindToStorage_Stub( HRESULT __RPC_STUB IMoniker_BindToStorage_Stub(
@ -2371,8 +2371,8 @@ HRESULT __RPC_STUB IMoniker_BindToStorage_Stub(
REFIID riid, REFIID riid,
IUnknown **ppvObj) IUnknown **ppvObj)
{ {
FIXME(":stub\n"); TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObj);
return E_NOTIMPL; return IMoniker_BindToStorage(This, pbc, pmkToLeft, riid, (void**)ppvObj);
} }
HRESULT CALLBACK IEnumString_Next_Proxy( HRESULT CALLBACK IEnumString_Next_Proxy(

View file

@ -130,7 +130,7 @@ reactos/dll/win32/ntprint # Synced to Wine-1.5.4
reactos/dll/win32/objsel # Synced to Wine-1.5.19 reactos/dll/win32/objsel # Synced to Wine-1.5.19
reactos/dll/win32/odbc32 # Out of sync. Depends on port of Linux ODBC. reactos/dll/win32/odbc32 # Out of sync. Depends on port of Linux ODBC.
reactos/dll/win32/odbccp32 # Synced to Wine-1.5.19 reactos/dll/win32/odbccp32 # Synced to Wine-1.5.19
reactos/dll/win32/ole32 # Synced to Wine-1.5.19 reactos/dll/win32/ole32 # Synced to Wine-1.5.26
reactos/dll/win32/oleacc # Autosync reactos/dll/win32/oleacc # Autosync
reactos/dll/win32/oleaut32 # Synced to Wine-1.5.19 reactos/dll/win32/oleaut32 # Synced to Wine-1.5.19
reactos/dll/win32/olecli32 # Synced to Wine-1.5.19 reactos/dll/win32/olecli32 # Synced to Wine-1.5.19