Sync to trunk revision 63875.

svn path=/branches/condrv_restructure/; revision=63876
This commit is contained in:
Hermès Bélusca-Maïto 2014-08-12 18:49:17 +00:00
parent 73cdd53b1d
commit de799f57dc
6 changed files with 41 additions and 33 deletions

View file

@ -1098,7 +1098,7 @@ CabinetExtractFile(PCAB_SEARCH Search)
Size -= OutputLength;
/* reduce remaining block size by bytes consumed */
RemainingBlock -= InputLength;
if (RemainingBlock == 0)
if (Size > 0 && RemainingBlock == 0)
{
/* used up this block, move on to the next */
DPRINT("Out of block data\n");

View file

@ -1120,7 +1120,7 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
* BufferStart and BufferEnd won't be reset when allocating memory for
* sending the response. we don't have to check for the new buffer here as
* it won't be used a type memory, only for buffer memory */
if (Pointer >= pStubMsg->BufferStart && Pointer < pStubMsg->BufferEnd)
if (Pointer >= pStubMsg->BufferStart && Pointer <= pStubMsg->BufferEnd)
goto notfree;
if (attr & RPC_FC_P_ONSTACK) {

View file

@ -1431,20 +1431,17 @@ HRESULT WINAPI CFSFolder::Drop(IDataObject *pDataObject,
_DoDropData *data = static_cast<_DoDropData*>(HeapAlloc(GetProcessHeap(), 0, sizeof(_DoDropData)));
data->This = this;
// Need to maintain this class in case the window is closed or the class exists temporarily (when dropping onto a folder).
pDataObject->AddRef();
pAsyncOperation->StartOperation(NULL);
CoMarshalInterThreadInterfaceInStream(IID_IDataObject, pDataObject, &data->pStream);
this->AddRef();
data->pDataObject = pDataObject;
data->pAsyncOperation = pAsyncOperation;
data->dwKeyState = dwKeyState;
data->pt = pt;
// Need to dereference as pdweffect gets freed.
data->pdwEffect = *pdwEffect;
data->pDataObject->AddRef();
data->pAsyncOperation->StartOperation(NULL);
SHCreateThread(CFSFolder::_DoDropThreadProc, data, NULL, NULL);
return S_OK;
}
else
pAsyncOperation->Release();
}
return this->_DoDrop(pDataObject, dwKeyState, pt, pdwEffect);
}
@ -1745,12 +1742,22 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject,
}
DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) {
CoInitialize(NULL);
_DoDropData *data = static_cast<_DoDropData*>(lpParameter);
HRESULT hr = data->This->_DoDrop(data->pDataObject, data->dwKeyState, data->pt, &data->pdwEffect);
IDataObject *pDataObject;
HRESULT hr = CoGetInterfaceAndReleaseStream (data->pStream, IID_IDataObject, (void**) &pDataObject);
if (SUCCEEDED(hr))
{
CComPtr<IAsyncOperation> pAsyncOperation;
hr = data->This->_DoDrop(pDataObject, data->dwKeyState, data->pt, &data->pdwEffect);
if (SUCCEEDED(pDataObject->QueryInterface(IID_PPV_ARG(IAsyncOperation, &pAsyncOperation))))
{
pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect);
}
pDataObject->Release();
}
//Release the CFSFolder and data object holds in the copying thread.
data->pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect);
data->pAsyncOperation->Release();
data->pDataObject->Release();
data->This->Release();
//Release the parameter from the heap.
HeapFree(GetProcessHeap(), 0, data);

View file

@ -123,8 +123,7 @@ class CFSFolder :
struct _DoDropData {
CFSFolder *This;
IDataObject *pDataObject;
IAsyncOperation *pAsyncOperation;
IStream *pStream;
DWORD dwKeyState;
POINTL pt;
DWORD pdwEffect;

View file

@ -170,7 +170,11 @@ InstallBuiltinAccounts(VOID)
for (i = 0; i < 10; i++)
{
ConvertStringSidToSid(BuiltinAccounts[i], &AccountSid);
if (!ConvertStringSidToSid(BuiltinAccounts[i], &AccountSid))
{
DPRINT1("ConvertStringSidToSid(%S) failed: %lu\n", BuiltinAccounts[i], GetLastError());
continue;
}
Status = LsaCreateAccount(PolicyHandle,
AccountSid,
@ -277,7 +281,11 @@ InstallPrivileges(VOID)
}
DPRINT("SID: %S\n", szSidString);
ConvertStringSidToSid(szSidString, &AccountSid);
if (!ConvertStringSidToSid(szSidString, &AccountSid))
{
DPRINT1("ConvertStringSidToSid(%S) failed: %lu\n", szSidString, GetLastError());
continue;
}
Status = LsaOpenAccount(PolicyHandle,
AccountSid,

View file

@ -315,28 +315,22 @@ FindRemoveAsyncMsg(PWND Wnd, WPARAM wParam)
pti = Wnd->head.pti;
if (!IsListEmpty(&pti->SentMessagesListHead))
Entry = pti->SentMessagesListHead.Flink;
while (Entry != &pti->SentMessagesListHead)
{
// Scan sent queue messages to see if we received async messages.
Entry = pti->SentMessagesListHead.Flink;
Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry);
do
{
if (IsListEmpty(Entry)) return;
if (!Message) return;
Entry = Message->ListEntry.Flink;
Entry = Entry->Flink;
if (Message->Msg.message == WM_ASYNC_SETACTIVEWINDOW &&
Message->Msg.hwnd == UserHMGetHandle(Wnd) &&
Message->Msg.wParam == wParam )
{
ERR("ASYNC SAW: Found one in the Sent Msg Queue! %p Activate/Deactivate %d\n", Message->Msg.hwnd,!!wParam);
RemoveEntryList(&Message->ListEntry); // Purge the entry.
ExFreePoolWithTag(Message, TAG_USRMSG);
}
Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry);
if (Message->Msg.message == WM_ASYNC_SETACTIVEWINDOW &&
Message->Msg.hwnd == UserHMGetHandle(Wnd) &&
Message->Msg.wParam == wParam)
{
ERR("ASYNC SAW: Found one in the Sent Msg Queue! %p Activate/Deactivate %d\n", Message->Msg.hwnd, !!wParam);
RemoveEntryList(&Message->ListEntry); // Purge the entry.
ClearMsgBitsMask(pti, Message->QS_Flags);
ExFreePoolWithTag(Message, TAG_USRMSG);
}
while (Entry != &pti->SentMessagesListHead);
}
}