mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[FORMATTING] Fix indentation
svn path=/trunk/; revision=31461
This commit is contained in:
parent
5f52a2893f
commit
3dce2f69c7
1 changed files with 71 additions and 71 deletions
|
@ -43,29 +43,29 @@ extern struct Application* SelectedApplication;
|
||||||
extern WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
|
extern WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
|
||||||
|
|
||||||
typedef struct _IBindStatusCallbackImpl
|
typedef struct _IBindStatusCallbackImpl
|
||||||
{
|
{
|
||||||
const IBindStatusCallbackVtbl *vtbl;
|
const IBindStatusCallbackVtbl *vtbl;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
HWND hDialog;
|
HWND hDialog;
|
||||||
BOOL *pbCancelled;
|
BOOL *pbCancelled;
|
||||||
} IBindStatusCallbackImpl;
|
} IBindStatusCallbackImpl;
|
||||||
|
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject)
|
dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject)
|
||||||
{
|
{
|
||||||
if (NULL == ppvObject)
|
if (NULL == ppvObject)
|
||||||
{
|
{
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IBindStatusCallback))
|
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IBindStatusCallback))
|
||||||
{
|
{
|
||||||
IBindStatusCallback_AddRef( This );
|
IBindStatusCallback_AddRef( This );
|
||||||
*ppvObject = This;
|
*ppvObject = This;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI
|
static ULONG WINAPI
|
||||||
|
@ -83,10 +83,10 @@ dlRelease(IBindStatusCallback* iface)
|
||||||
DWORD ref = InterlockedDecrement(&This->ref);
|
DWORD ref = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
if( !ref )
|
if( !ref )
|
||||||
{
|
{
|
||||||
DestroyWindow( This->hDialog );
|
DestroyWindow( This->hDialog );
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ dlOnLowResource( IBindStatusCallback* iface, DWORD reserved)
|
||||||
|
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress,
|
dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress,
|
||||||
ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
|
ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
|
||||||
{
|
{
|
||||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
||||||
HWND Item;
|
HWND Item;
|
||||||
|
@ -126,29 +126,29 @@ dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress,
|
||||||
|
|
||||||
Item = GetDlgItem(This->hDialog, IDC_PROGRESS);
|
Item = GetDlgItem(This->hDialog, IDC_PROGRESS);
|
||||||
if (NULL != Item && 0 != ulProgressMax)
|
if (NULL != Item && 0 != ulProgressMax)
|
||||||
{
|
{
|
||||||
SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0);
|
SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Item = GetDlgItem(This->hDialog, IDC_STATUS);
|
Item = GetDlgItem(This->hDialog, IDC_STATUS);
|
||||||
if (NULL != Item && NULL != szStatusText)
|
if (NULL != Item && NULL != szStatusText)
|
||||||
{
|
{
|
||||||
SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]),
|
SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]),
|
||||||
(LPARAM) OldText);
|
(LPARAM) OldText);
|
||||||
if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || 0 != wcscmp(OldText, szStatusText))
|
if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || 0 != wcscmp(OldText, szStatusText))
|
||||||
{
|
{
|
||||||
SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText);
|
SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA);
|
r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA);
|
||||||
if (0 != r || 0 != GetLastError())
|
if (0 != r || 0 != GetLastError())
|
||||||
{
|
{
|
||||||
*This->pbCancelled = TRUE;
|
*This->pbCancelled = TRUE;
|
||||||
DPRINT("Cancelled\n");
|
DPRINT("Cancelled\n");
|
||||||
return E_ABORT;
|
return E_ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ dlGetBindInfo(IBindStatusCallback* iface, DWORD* grfBINDF, BINDINFO* pbindinfo)
|
||||||
|
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF,
|
dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF,
|
||||||
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
|
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
|
||||||
{
|
{
|
||||||
DPRINT1("OnDataAvailable implemented\n");
|
DPRINT1("OnDataAvailable implemented\n");
|
||||||
|
|
||||||
|
@ -188,17 +188,17 @@ dlOnObjectAvailable(IBindStatusCallback* iface, REFIID riid, IUnknown* punk)
|
||||||
|
|
||||||
static const IBindStatusCallbackVtbl dlVtbl =
|
static const IBindStatusCallbackVtbl dlVtbl =
|
||||||
{
|
{
|
||||||
dlQueryInterface,
|
dlQueryInterface,
|
||||||
dlAddRef,
|
dlAddRef,
|
||||||
dlRelease,
|
dlRelease,
|
||||||
dlOnStartBinding,
|
dlOnStartBinding,
|
||||||
dlGetPriority,
|
dlGetPriority,
|
||||||
dlOnLowResource,
|
dlOnLowResource,
|
||||||
dlOnProgress,
|
dlOnProgress,
|
||||||
dlOnStopBinding,
|
dlOnStopBinding,
|
||||||
dlGetBindInfo,
|
dlGetBindInfo,
|
||||||
dlOnDataAvailable,
|
dlOnDataAvailable,
|
||||||
dlOnObjectAvailable
|
dlOnObjectAvailable
|
||||||
};
|
};
|
||||||
|
|
||||||
static IBindStatusCallback*
|
static IBindStatusCallback*
|
||||||
|
@ -287,18 +287,18 @@ ThreadFunc(LPVOID Context)
|
||||||
dl = CreateDl(Context, &bCancelled);
|
dl = CreateDl(Context, &bCancelled);
|
||||||
r = URLDownloadToFileW(NULL, SelectedApplication->Location, path, 0, dl);
|
r = URLDownloadToFileW(NULL, SelectedApplication->Location, path, 0, dl);
|
||||||
if (NULL != dl)
|
if (NULL != dl)
|
||||||
{
|
{
|
||||||
IBindStatusCallback_Release(dl);
|
IBindStatusCallback_Release(dl);
|
||||||
}
|
}
|
||||||
if (S_OK != r)
|
if (S_OK != r)
|
||||||
{
|
{
|
||||||
MessageBoxW(0,Strings[IDS_DOWNLOAD_ERROR],0,0);
|
MessageBoxW(0,Strings[IDS_DOWNLOAD_ERROR],0,0);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
else if (bCancelled)
|
else if (bCancelled)
|
||||||
{
|
{
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
ShowWindow(Dlg, SW_HIDE);
|
ShowWindow(Dlg, SW_HIDE);
|
||||||
|
|
||||||
/* run it */
|
/* run it */
|
||||||
|
@ -306,9 +306,9 @@ ThreadFunc(LPVOID Context)
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
|
r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
|
||||||
if (0 == r)
|
if (0 == r)
|
||||||
{
|
{
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
|
@ -340,7 +340,7 @@ DownloadProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
HWND Item;
|
HWND Item;
|
||||||
|
|
||||||
switch (Msg)
|
switch (Msg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:/*
|
case WM_INITDIALOG:/*
|
||||||
Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE),
|
Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE),
|
||||||
MAKEINTRESOURCEW(IDI_ICON_MAIN));
|
MAKEINTRESOURCEW(IDI_ICON_MAIN));
|
||||||
|
@ -349,13 +349,13 @@ DownloadProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon);
|
SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon);
|
||||||
SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon);
|
SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon);
|
||||||
}*/
|
}*/
|
||||||
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
|
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
|
||||||
Item = GetDlgItem(Dlg, IDC_PROGRESS);
|
Item = GetDlgItem(Dlg, IDC_PROGRESS);
|
||||||
if (NULL != Item)
|
if (NULL != Item)
|
||||||
{
|
{
|
||||||
SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100));
|
SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100));
|
||||||
SendMessageW(Item, PBM_SETPOS, 0, 0);
|
SendMessageW(Item, PBM_SETPOS, 0, 0);
|
||||||
}/*
|
}/*
|
||||||
Item = GetDlgItem(Dlg, IDC_REMOVE);
|
Item = GetDlgItem(Dlg, IDC_REMOVE);
|
||||||
if (NULL != Item)
|
if (NULL != Item)
|
||||||
{
|
{
|
||||||
|
@ -370,27 +370,27 @@ DownloadProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
ShowWindow(Item, SW_HIDE);
|
ShowWindow(Item, SW_HIDE);
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId);
|
Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId);
|
||||||
if (NULL == Thread)
|
if (NULL == Thread)
|
||||||
{
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
CloseHandle(Thread);
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
if (wParam == IDCANCEL)
|
||||||
|
{
|
||||||
|
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1);
|
||||||
|
PostMessage(Dlg, WM_CLOSE, 0, 0);
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
CloseHandle(Thread);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_CLOSE:
|
||||||
if (wParam == IDCANCEL)
|
EndDialog(Dlg, 0);
|
||||||
{
|
return TRUE;
|
||||||
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1);
|
|
||||||
PostMessage(Dlg, WM_CLOSE, 0, 0);
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
case WM_CLOSE:
|
default:
|
||||||
EndDialog(Dlg, 0);
|
return FALSE;
|
||||||
return TRUE;
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue