ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
40 participants
704 discussions
Start a n
N
ew thread
[gvg] 20096: Add small utility to download/install Firefox
by gvg@svn.reactos.com
Add small utility to download/install Firefox Modified: trunk/reactos/apps/utils/directory.xml Added: trunk/reactos/apps/utils/getfirefox/ Added: trunk/reactos/apps/utils/getfirefox/En.rc Added: trunk/reactos/apps/utils/getfirefox/firefox.ico Added: trunk/reactos/apps/utils/getfirefox/getfirefox.c Added: trunk/reactos/apps/utils/getfirefox/getfirefox.rc Added: trunk/reactos/apps/utils/getfirefox/getfirefox.xml Added: trunk/reactos/apps/utils/getfirefox/precomp.h Added: trunk/reactos/apps/utils/getfirefox/resource.h Modified: trunk/reactos/bootdata/packages/reactos.dff Modified: trunk/reactos/lib/syssetup/install.c Modified: trunk/reactos/lib/syssetup/resource.h Modified: trunk/reactos/lib/syssetup/syssetup_En.rc _____ Modified: trunk/reactos/apps/utils/directory.xml --- trunk/reactos/apps/utils/directory.xml 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/directory.xml 2005-12-12 00:23:07 UTC (rev 20096) @@ -2,6 +2,9 @@ <directory name="net"> <xi:include href="net/directory.xml" /> </directory> +<directory name="getfirefox"> + <xi:include href="getfirefox/getfirefox.xml" /> +</directory> <directory name="shutdown"> <xi:include href="shutdown/shutdown.xml" /> </directory> Property changes on: trunk/reactos/apps/utils/getfirefox ___________________________________________________________________ Name: svn:ignore + GNUmakefile _____ Added: trunk/reactos/apps/utils/getfirefox/En.rc --- trunk/reactos/apps/utils/getfirefox/En.rc 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/getfirefox/En.rc 2005-12-12 00:23:07 UTC (rev 20096) @@ -0,0 +1,44 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/En.rc + * PURPOSE: English resources + * COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers + * Copyright 2005 Ge van Geldorp (gvg(a)reactos.org) + */ +/* + * Based on Wine dlls/shdocvw/En.rc + * + * 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 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Downloading Firefox" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10, 200,12 + LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER + CHECKBOX "Remove \"Get Firefox\" from Start Menu when done", IDC_REMOVE, + 10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE +BEGIN + IDS_START_MENU_NAME "Get Firefox" +END Property changes on: trunk/reactos/apps/utils/getfirefox/En.rc ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: trunk/reactos/apps/utils/getfirefox/firefox.ico (Binary files differ) Property changes on: trunk/reactos/apps/utils/getfirefox/firefox.ico ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream _____ Added: trunk/reactos/apps/utils/getfirefox/getfirefox.c --- trunk/reactos/apps/utils/getfirefox/getfirefox.c 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/getfirefox/getfirefox.c 2005-12-12 00:23:07 UTC (rev 20096) @@ -0,0 +1,378 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/getfirefox.c + * PURPOSE: Main program + * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers) + * Copyright 2004 Mike McCormack (for CodeWeavers) + * Copyright 2005 Ge van Geldorp (gvg(a)reactos.org) + */ +/* + * Based on Wine dlls/shdocvw/shdocvw_main.c + * + * 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 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include <precomp.h> + +#define NDEBUG +#include <debug.h> + +#define DOWNLOAD_URL L"
http://links.reactos.org/getfirefox
" + +typedef struct _IBindStatusCallbackImpl + { + const IBindStatusCallbackVtbl *vtbl; + LONG ref; + HWND hDialog; + BOOL *pbCancelled; + } IBindStatusCallbackImpl; + +static HRESULT WINAPI +dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject) +{ + if (NULL == ppvObject) + { + return E_POINTER; + } + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IBindStatusCallback)) + { + IBindStatusCallback_AddRef( This ); + *ppvObject = This; + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI +dlAddRef(IBindStatusCallback* iface) +{ + IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; + + return InterlockedIncrement(&This->ref); +} + +static ULONG WINAPI +dlRelease(IBindStatusCallback* iface) +{ + IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; + DWORD ref = InterlockedDecrement(&This->ref); + + if( !ref ) + { + DestroyWindow( This->hDialog ); + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI +dlOnStartBinding(IBindStatusCallback* iface, DWORD dwReserved, IBinding* pib) +{ + DPRINT1("OnStartBinding not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlGetPriority(IBindStatusCallback* iface, LONG* pnPriority) +{ + DPRINT1("GetPriority not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnLowResource( IBindStatusCallback* iface, DWORD reserved) +{ + DPRINT1("OnLowResource not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress, + ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) +{ + IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; + HWND Item; + LONG r; + WCHAR OldText[100]; + + Item = GetDlgItem(This->hDialog, IDC_PROGRESS); + if (NULL != Item && 0 != ulProgressMax) + { + SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0); + } + + Item = GetDlgItem(This->hDialog, IDC_STATUS); + if (NULL != Item) + { + SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]), + (LPARAM) OldText); + if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || + 0 != wcscmp(OldText, szStatusText)) + { + SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText); + } + } + + SetLastError(0); + r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA); + if (0 != r || 0 != GetLastError()) + { + *This->pbCancelled = TRUE; + DPRINT("Cancelled\n"); + return E_ABORT; + } + + return S_OK; +} + +static HRESULT WINAPI +dlOnStopBinding(IBindStatusCallback* iface, HRESULT hresult, LPCWSTR szError) +{ + DPRINT1("OnStopBinding not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlGetBindInfo(IBindStatusCallback* iface, DWORD* grfBINDF, BINDINFO* pbindinfo) +{ + DPRINT1("GetBindInfo not implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF, + DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) +{ + DPRINT1("OnDataAvailable implemented\n"); + + return S_OK; +} + +static HRESULT WINAPI +dlOnObjectAvailable(IBindStatusCallback* iface, REFIID riid, IUnknown* punk) +{ + DPRINT1("OnObjectAvailable implemented\n"); + + return S_OK; +} + +static const IBindStatusCallbackVtbl dlVtbl = +{ + dlQueryInterface, + dlAddRef, + dlRelease, + dlOnStartBinding, + dlGetPriority, + dlOnLowResource, + dlOnProgress, + dlOnStopBinding, + dlGetBindInfo, + dlOnDataAvailable, + dlOnObjectAvailable +}; + +static IBindStatusCallback* +CreateDl(HWND Dlg, BOOL *pbCancelled) +{ + IBindStatusCallbackImpl *This; + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(IBindStatusCallbackImpl)); + This->vtbl = &dlVtbl; + This->ref = 1; + This->hDialog = Dlg; + This->pbCancelled = pbCancelled; + + return (IBindStatusCallback*) This; +} + +static BOOL +GetShortcutName(LPWSTR ShortcutName) +{ + if (! SHGetSpecialFolderPathW(0, ShortcutName, CSIDL_PROGRAMS, FALSE)) + { + return FALSE; + } + if (NULL == PathAddBackslashW(ShortcutName)) + { + return FALSE; + } + if (0 == LoadStringW(GetModuleHandle(NULL), IDS_START_MENU_NAME, + ShortcutName + wcslen(ShortcutName), + MAX_PATH - wcslen(ShortcutName))) + { + return FALSE; + } + if (MAX_PATH - 5 < wcslen(ShortcutName)) + { + return FALSE; + } + wcscat(ShortcutName, L".lnk"); + + return TRUE; +} + +static DWORD WINAPI +ThreadFunc(LPVOID Context) +{ + static const WCHAR szUrl[] = DOWNLOAD_URL; + IBindStatusCallback *dl; + WCHAR path[MAX_PATH], ShortcutName[MAX_PATH]; + LPWSTR p; + STARTUPINFOW si; + PROCESS_INFORMATION pi; + HWND Dlg = (HWND) Context; + DWORD r; + BOOL bCancelled = FALSE; + BOOL bTempfile = FALSE; + + /* built the path for the download */ + p = wcsrchr(szUrl, L'/'); + if (NULL == p) + { + goto end; + } + if (! GetTempPathW(MAX_PATH, path)) + { + goto end; + } + wcscat(path, p + 1); + + /* download it */ + bTempfile = TRUE; + dl = CreateDl(Context, &bCancelled); + r = URLDownloadToFileW(NULL, szUrl, path, 0, dl); + if (NULL != dl) + { + IBindStatusCallback_Release(dl); + } + if (S_OK != r || bCancelled ) + { + goto end; + } + ShowWindow(Dlg, SW_HIDE); + + /* run it */ + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi); + if (0 == r) + { + goto end; + } + CloseHandle(pi.hThread); + WaitForSingleObject(pi.hProcess, INFINITE); + CloseHandle(pi.hProcess); + + if (BST_CHECKED == SendMessageW(GetDlgItem(Dlg, IDC_REMOVE), BM_GETCHECK, + 0, 0) && + GetShortcutName(ShortcutName)) + { + DeleteFileW(ShortcutName); + } + +end: + if (bTempfile) + { + DeleteFileW(path); + } + EndDialog(Dlg, 0); + return 0; +} + +static INT_PTR CALLBACK +dlProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + HANDLE Thread; + DWORD ThreadId; + HWND Item; + HICON Icon; + WCHAR ShortcutName[MAX_PATH]; + + switch (Msg) + { + case WM_INITDIALOG: + Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE), + MAKEINTRESOURCEW(IDI_ICON_MAIN)); + if (NULL != Icon) + { + SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon); + SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon); + } + SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); + Item = GetDlgItem(Dlg, IDC_PROGRESS); + if (NULL != Item) + { + SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100)); + SendMessageW(Item, PBM_SETPOS, 0, 0); + } + Item = GetDlgItem(Dlg, IDC_REMOVE); + if (NULL != Item) + { + if (GetShortcutName(ShortcutName) && + INVALID_FILE_ATTRIBUTES != GetFileAttributesW(ShortcutName)) + { + SendMessageW(Item, BM_SETCHECK, BST_CHECKED, 0); + } + else + { + SendMessageW(Item, BM_SETCHECK, BST_UNCHECKED, 0); + ShowWindow(Item, SW_HIDE); + } + } + Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId); + if (NULL == Thread) + { + return FALSE; + } + CloseHandle(Thread); + return TRUE; + + case WM_COMMAND: + if (wParam == IDCANCEL) + { + SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1); + } + return FALSE; + + default: + return FALSE; + } +} + + +/********************************************************************** * + * Main program + */ +int +main(int argc, char *argv[]) +{ + InitCommonControls(); + + DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_GETFIREFOX), 0, + dlProc); + + return 0; +} Property changes on: trunk/reactos/apps/utils/getfirefox/getfirefox.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: trunk/reactos/apps/utils/getfirefox/getfirefox.rc --- trunk/reactos/apps/utils/getfirefox/getfirefox.rc 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/getfirefox/getfirefox.rc 2005-12-12 00:23:07 UTC (rev 20096) @@ -0,0 +1,25 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/getfirefox.rc + * PURPOSE: Language-independent resources + * COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg(a)reactos.org) + */ + +#include <windows.h> +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "Firefox downloader\0" +#define REACTOS_STR_INTERNAL_NAME "getfirefox\0" +#define REACTOS_STR_ORIGINAL_FILENAME "getfirefox.exe\0" +#include <reactos/version.rc> + +/* + * Note: this icon is the "default logo" referenced here: + *
http://www.mozilla.org/foundation/trademarks/faq.html
(under "What are the + * Mozilla Trademarks and Logos?"). Don't use the official Firefox logo as it + * is trademarked. + */ +1 ICON "firefox.ico" + +#include "En.rc" Property changes on: trunk/reactos/apps/utils/getfirefox/getfirefox.rc ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: trunk/reactos/apps/utils/getfirefox/getfirefox.xml --- trunk/reactos/apps/utils/getfirefox/getfirefox.xml 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/getfirefox/getfirefox.xml 2005-12-12 00:23:07 UTC (rev 20096) @@ -0,0 +1,17 @@ +<module name="getfirefox" type="win32gui" installbase="system32" installname="getfirefox.exe"> + <include base="getfirefox">.</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__USE_W32API" /> + <define name="WINVER">0x0501</define> + <define name="_WIN32_IE>0x0600</define> + <library>comctl32</library> + <library>ntdll</library> + <library>shell32</library> + <library>shlwapi</library> + <library>urlmon</library> + <library>uuid</library> + <pch>precomp.h</pch> + <file>getfirefox.c</file> + <file>getfirefox.rc</file> +</module> Property changes on: trunk/reactos/apps/utils/getfirefox/getfirefox.xml ___________________________________________________________________ Name: svn:eol-style + native _____ Added: trunk/reactos/apps/utils/getfirefox/precomp.h --- trunk/reactos/apps/utils/getfirefox/precomp.h 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/getfirefox/precomp.h 2005-12-12 00:23:07 UTC (rev 20096) @@ -0,0 +1,19 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/precomp.h + * PURPOSE: Precompiled header file + * COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg(a)reactos.org) + */ + +#define COBJMACROS +#define NTOS_MODE_USER +#define WIN32_NO_STATUS +#include <windows.h> +#include <ndk/ntndk.h> +#include <commctrl.h> +#include <shlobj.h> +#include <shlwapi.h> +#include <urlmon.h> + +#include "resource.h" Property changes on: trunk/reactos/apps/utils/getfirefox/precomp.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Added: trunk/reactos/apps/utils/getfirefox/resource.h --- trunk/reactos/apps/utils/getfirefox/resource.h 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/apps/utils/getfirefox/resource.h 2005-12-12 00:23:07 UTC (rev 20096) @@ -0,0 +1,17 @@ +/* + * PROJECT: ReactOS utilities + * LICENSE: GPL - See COPYING in the top level directory + * FILE: apps/utils/getfirefox/resource.h + * PURPOSE: Resource constants + * COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg(a)reactos.org) + */ + +#define IDI_ICON_MAIN 1 + +#define IDD_GETFIREFOX 100 + +#define IDC_PROGRESS 1000 +#define IDC_STATUS 1001 +#define IDC_REMOVE 1002 + +#define IDS_START_MENU_NAME 1100 Property changes on: trunk/reactos/apps/utils/getfirefox/resource.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-12-12 00:23:07 UTC (rev 20096) @@ -227,6 +227,7 @@ apps\utils\ps\ps.exe 1 apps\utils\rosperf\rosperf.exe 1 apps\utils\shutdown\shutdown.exe 1 +apps\utils\getfirefox\getfirefox.exe 1 media\fonts\c0419bt_.ttf 3 media\fonts\c0582bt_.ttf 3 media\fonts\c0583bt_.ttf 3 _____ Modified: trunk/reactos/lib/syssetup/install.c --- trunk/reactos/lib/syssetup/install.c 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/lib/syssetup/install.c 2005-12-12 00:23:07 UTC (rev 20096) @@ -415,6 +415,7 @@ /* create program startmenu shortcuts */ CreateShortcut(CSIDL_PROGRAMS, NULL, _T("winefile.lnk"), _T("winefile.exe"), IDS_CMT_WINEFILE); CreateShortcut(CSIDL_PROGRAMS, NULL, _T("ibrowser.lnk"), _T("ibrowser.exe"), IDS_CMT_IBROWSER); + CreateShortcut(CSIDL_PROGRAMS, NULL, _T("Get Firefox.lnk"), _T("getfirefox.exe"), IDS_CMT_GETFIREFOX); /* create and fill Accessories subfolder */ if (CreateShortcutFolder(CSIDL_PROGRAMS, IDS_ACCESSORIES, sAccessories, 256)) { _____ Modified: trunk/reactos/lib/syssetup/resource.h --- trunk/reactos/lib/syssetup/resource.h 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/lib/syssetup/resource.h 2005-12-12 00:23:07 UTC (rev 20096) @@ -96,6 +96,7 @@ #define IDS_CMT_SOLITAIRE 3216 #define IDS_CMT_WINEMINE 3217 #define IDS_CMT_IBROWSER 3218 +#define IDS_CMT_GETFIREFOX 3219 #define IDS_REACTOS_SETUP 3300 #define IDS_UNKNOWN_ERROR 3301 _____ Modified: trunk/reactos/lib/syssetup/syssetup_En.rc --- trunk/reactos/lib/syssetup/syssetup_En.rc 2005-12-12 00:06:38 UTC (rev 20095) +++ trunk/reactos/lib/syssetup/syssetup_En.rc 2005-12-12 00:23:07 UTC (rev 20096) @@ -183,7 +183,8 @@ STRINGTABLE BEGIN IDS_CMT_WINEFILE "Launch Winefile" - IDS_CMT_IBROWSER "Launch iBrowser" + IDS_CMT_IBROWSER "Launch iBrowser" + IDS_CMT_GETFIREFOX "Download/install Firefox" END STRINGTABLE
19 years
1
0
0
0
[cwittich] 20095: better stubs for VerLanguageNameA/W (untested)
by cwittich@svn.reactos.com
better stubs for VerLanguageNameA/W (untested) Modified: trunk/reactos/lib/kernel32/misc/stubs.c _____ Modified: trunk/reactos/lib/kernel32/misc/stubs.c --- trunk/reactos/lib/kernel32/misc/stubs.c 2005-12-11 23:53:23 UTC (rev 20094) +++ trunk/reactos/lib/kernel32/misc/stubs.c 2005-12-12 00:06:38 UTC (rev 20095) @@ -355,7 +355,9 @@ ) { STUB; - return 0; + szLang = "Language Neutral\0"; + nSize = sizeof(szLang) * sizeof(CHAR); + return sizeof(szLang) - 1; } @@ -371,7 +373,9 @@ ) { STUB; - return 0; + szLang = L"Language Neutral\0"; + nSize = sizeof(szLang) * sizeof(WCHAR); + return sizeof(szLang) - 1; }
19 years
1
0
0
0
[greatlrd] 20094: NtGdiDdQueryDirectDrawObject do not setup wrong callback to struct members. Check for some NULL parama that can not be NULL.
by greatlrd@svn.reactos.com
NtGdiDdQueryDirectDrawObject do not setup wrong callback to struct members. Check for some NULL parama that can not be NULL. Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c _____ Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c --- trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-12-11 23:45:44 UTC (rev 20093) +++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-12-11 23:53:23 UTC (rev 20094) @@ -13,6 +13,10 @@ #define NDEBUG #include <debug.h> +/* swtich this off to get rid of all dx debug msg */ +#define DX_DEBUG + + /*********************************************************************** */ /* DIRECT DRAW OBJECT */ /*********************************************************************** */ @@ -21,7 +25,9 @@ DD_Cleanup(PVOID ObjectBody) { PDD_DIRECTDRAW pDirectDraw = (PDD_DIRECTDRAW) ObjectBody; +#ifdef DX_DEBUG DPRINT1("DD_Cleanup\n"); +#endif if (!pDirectDraw) return FALSE; @@ -43,7 +49,9 @@ DD_CALLBACKS callbacks; DD_SURFACECALLBACKS surface_callbacks; DD_PALETTECALLBACKS palette_callbacks; +#ifdef DX_DEBUG DPRINT1("NtGdiDdCreateDirectDrawObject\n"); +#endif RtlZeroMemory(&callbacks, sizeof(DD_CALLBACKS)); callbacks.dwSize = sizeof(DD_CALLBACKS); @@ -75,7 +83,9 @@ if (!success) { +#ifdef DX_DEBUG DPRINT1("DirectDraw creation failed\n"); +#endif // DirectDraw creation failed DC_UnlockDc(pDC); return NULL; @@ -85,7 +95,9 @@ if (!hDirectDraw) { /* No more memmory */ +#ifdef DX_DEBUG DPRINT1("No more memmory\n"); +#endif DC_UnlockDc(pDC); return NULL; } @@ -94,7 +106,9 @@ if (!pDirectDraw) { /* invalid handle */ +#ifdef DX_DEBUG DPRINT1("invalid handle\n"); +#endif DC_UnlockDc(pDC); return NULL; } @@ -125,13 +139,15 @@ HANDLE hDirectDrawLocal ) { +#ifdef DX_DEBUG DPRINT1("NtGdiDdDeleteDirectDrawObject\n"); +#endif return GDIOBJ_FreeObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); } BOOL STDCALL NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal, - DD_HALINFO *pHalInfo, + DD_HALINFO *pHalInfo, DWORD *pCallBackFlags, LPD3DNTHAL_CALLBACKS puD3dCallbacks, LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData, @@ -143,13 +159,51 @@ DWORD *puFourCC ) { +#ifdef DX_DEBUG + DPRINT1("NtGdiDdQueryDirectDrawObject\n"); +#endif + + /* Check for NULL pointer to prevent any one doing a mistake */ + + if (hDirectDrawLocal == NULL) + { +#ifdef DX_DEBUG + DPRINT1("warning hDirectDraw handler is NULL, the handler is DDRAWI_DIRECTDRAW_GBL.hDD\n"); + DPRINT1("and it is NtGdiDdCreateDirectDrawObject return value\n"); +#endif + return FALSE; + } + + + if (pHalInfo == NULL) + { +#ifdef DX_DEBUG + DPRINT1("warning pHalInfo buffer is NULL \n"); +#endif + return FALSE; + } + + if ( pCallBackFlags == NULL) + { +#ifdef DX_DEBUG + DPRINT1("warning pCallBackFlags s NULL, the size must be 3*DWORD in follow order \n"); + DPRINT1("pCallBackFlags[0] = flags in DD_CALLBACKS\n"); + DPRINT1("pCallBackFlags[1] = flags in DD_SURFACECALLBACKS\n"); + DPRINT1("pCallBackFlags[2] = flags in DD_PALETTECALLBACKS\n"); +#endif + return FALSE; + } + + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); - DPRINT1("NtGdiDdQueryDirectDrawObject\n"); + if (!pDirectDraw) { /* Fail to Lock DirectDraw handle */ +#ifdef DX_DEBUG DPRINT1(" Fail to Lock DirectDraw handle \n"); +#endif return FALSE; } @@ -163,38 +217,133 @@ if (!success) { +#ifdef DX_DEBUG DPRINT1(" Fail to get DirectDraw driver info \n"); +#endif GDIOBJ_UnlockObjByPtr(pDirectDraw); return FALSE; } + + /* rest the flag so we do not need do it later */ + pCallBackFlags[0]=0; + pCallBackFlags[1]=0; + pCallBackFlags[2]=0; + if (pHalInfo) - { - DPRINT1("Found DirectDraw CallBack for 2D Hal\n"); - RtlMoveMemory(&pDirectDraw->Hal, pHalInfo, sizeof(DD_HALINFO)); + { + + { + DDHALINFO* pHalInfo2 = ((DDHALINFO*) pHalInfo); +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 2D and 3D Hal\n"); +#endif + RtlMoveMemory(&pDirectDraw->Hal, pHalInfo2, sizeof(DDHALINFO)); - if (pHalInfo->lpD3DHALCallbacks) - { - DPRINT1("Found DirectDraw CallBack for 3D Hal\n"); - RtlMoveMemory(puD3dCallbacks, pHalInfo->lpD3DHALCallbacks, sizeof(D3DNTHAL_CALLBACKS)); + if (pHalInfo2->lpDDExeBufCallbacks) + { +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal Bufffer \n"); +#endif + /* msdn DDHAL_D3DBUFCALLBACKS = DD_D3DBUFCALLBACKS */ + RtlMoveMemory(puD3dBufferCallbacks, pHalInfo2->lpDDExeBufCallbacks, sizeof(DD_D3DBUFCALLBACKS)); + } + +#ifdef DX_DEBUG + DPRINT1("Do not support CallBack for 3D Hal\n"); +#endif + /* FIXME we need D3DHAL be include + + if (pHalInfo2->lpD3DHALCallbacks ) + { +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal\n"); +#endif + RtlMoveMemory(puD3dCallbacks, (ULONG *)pHalInfo2->lpD3DHALCallbacks, sizeof( D3DHAL_CALLBACKS )); + } + */ + + + /* msdn say D3DHAL_GLOBALDRIVERDATA and D3DNTHAL_GLOBALDRIVERDATA are not same + but if u compare these in msdn it is exacly same */ + + if (pHalInfo->lpD3DGlobalDriverData) + { +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal Private \n"); +#endif + RtlMoveMemory(puD3dDriverData, (ULONG *)pHalInfo2->lpD3DGlobalDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA)); + } + + /* build the flag */ + + if (pHalInfo2->lpDDCallbacks!=NULL) + { +#ifdef DX_DEBUG + DPRINT1("Dectect DirectDraw lpDDCallbacks for 2D Hal flag = %d\n",pHalInfo2->lpDDCallbacks->dwFlags); +#endif + pCallBackFlags[0] = pHalInfo2->lpDDCallbacks->dwFlags; + } + + if (pHalInfo2->lpDDCallbacks!=NULL) + { +#ifdef DX_DEBUG + DPRINT1("Dectect DirectDraw lpDDSurfaceCallbacks for 2D Hal flag = %d\n",pHalInfo2->lpDDSurfaceCallbacks->dwFlags); +#endif + pCallBackFlags[1] = pHalInfo2->lpDDSurfaceCallbacks->dwFlags; + } + + if (pHalInfo2->lpDDCallbacks!=NULL) + { +#ifdef DX_DEBUG + DPRINT1("Dectect DirectDraw lpDDCallbacks for 2D Hal flag = %d\n",pHalInfo2->lpDDPaletteCallbacks->dwFlags); +#endif + pCallBackFlags[2] = pHalInfo2->lpDDPaletteCallbacks->dwFlags; + } + + } + +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal\n"); +#endif + RtlMoveMemory(&pDirectDraw->Hal, pHalInfo, sizeof(DD_HALINFO)); + + if (pHalInfo->lpD3DBufCallbacks) + { +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal Bufffer \n"); +#endif + RtlMoveMemory(puD3dBufferCallbacks, pHalInfo->lpD3DBufCallbacks, sizeof(DD_D3DBUFCALLBACKS)); + } + + if (pHalInfo->lpD3DHALCallbacks) + { +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal\n"); +#endif + RtlMoveMemory(puD3dCallbacks, pHalInfo->lpD3DHALCallbacks, sizeof(D3DNTHAL_CALLBACKS)); + } + + if (pHalInfo->lpD3DGlobalDriverData) + { +#ifdef DX_DEBUG + DPRINT1("Found DirectDraw CallBack for 3D Hal Private \n"); +#endif + RtlMoveMemory(puD3dDriverData, pHalInfo->lpD3DGlobalDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA)); + } + +#ifdef DX_DEBUG + DPRINT1("Unkown DirectX driver interface\n"); +#endif + } - if (pHalInfo->lpD3DGlobalDriverData) - { - DPRINT1("Found DirectDraw CallBack for 3D Hal Private \n"); - RtlMoveMemory(puD3dDriverData, pHalInfo->lpD3DGlobalDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA)); - } - if (pHalInfo->lpD3DBufCallbacks) - { - DPRINT1("Found DirectDraw CallBack for 3D Hal Bufffer \n"); - RtlMoveMemory(puD3dBufferCallbacks, pHalInfo->lpD3DBufCallbacks, sizeof(DD_D3DBUFCALLBACKS)); - } - - } +#ifdef DX_DEBUG else { DPRINT1("No DirectDraw Hal info have been found, it did not fail, it did gather some other info \n"); } +#endif GDIOBJ_UnlockObjByPtr(pDirectDraw); @@ -210,11 +359,15 @@ DWORD ddRVal = 0; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdGetDriverInfo\n"); +#endif if (pDirectDraw == NULL) { +#ifdef DX_DEBUG DPRINT1("Can not lock DirectDraw handle \n"); +#endif return DDHAL_DRIVER_NOTHANDLED; } @@ -230,7 +383,9 @@ /* Now we are doing the call to drv DrvGetDriverInfo */ if (ddRVal == 2) { +#ifdef DX_DEBUG DPRINT1("NtGdiDdGetDriverInfo DDHAL_DRIVER_NOTHANDLED"); +#endif ddRVal = DDHAL_DRIVER_NOTHANDLED; } else @@ -259,12 +414,16 @@ { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_DIRECTDRAW_GLOBAL lgpl; +#ifdef DX_DEBUG DPRINT1("NtGdiDdCreateSurface\n"); +#endif PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) { +#ifdef DX_DEBUG DPRINT1("Can not lock the DirectDraw handle\n"); +#endif return DDHAL_DRIVER_NOTHANDLED; } @@ -277,7 +436,9 @@ /* make the call */ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE)) { +#ifdef DX_DEBUG DPRINT1("DirectDraw HAL does not support Create Surface"); +#endif ddRVal = DDHAL_DRIVER_NOTHANDLED; } else @@ -299,7 +460,9 @@ { DWORD ddRVal; PDD_DIRECTDRAW_GLOBAL lgpl; +#ifdef DX_DEBUG DPRINT1("NtGdiDdWaitForVerticalBlank\n"); +#endif PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); @@ -334,7 +497,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdCanCreateSurface\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -366,7 +531,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdGetScanLine\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -405,7 +572,9 @@ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdDestroySurface\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -444,7 +613,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceTarget, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdFlip\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -478,7 +649,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdLock\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -510,7 +683,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdUnlock\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -543,7 +718,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDest, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdBlt\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -575,7 +752,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdSetColorKey\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -609,7 +788,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceAttached, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdAddAttachedSurface\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -641,7 +822,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdGetBltStatus\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -673,7 +856,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdGetFlipStatus\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -706,7 +891,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdUpdateOverlay\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -739,7 +926,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdSetOverlayPosition\n"); +#endif if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; @@ -773,7 +962,9 @@ /* FIXME: implement * PDD_SURFACE pDDSurf = PVOID pDDSurf */ +#ifdef DX_DEBUG DPRINT1("DDSURF_Cleanup\n"); +#endif return TRUE; } @@ -787,7 +978,9 @@ ) { PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdCreateSurfaceObject\n"); +#endif if (!pDirectDraw) return NULL; @@ -818,7 +1011,9 @@ HANDLE hSurface ) { +#ifdef DX_DEBUG DPRINT1("NtGdiDdDeleteSurfaceObject\n"); +#endif /* FIXME add right GDI_OBJECT_TYPE_ for everthing for now we are using same type */ /* return GDIOBJ_FreeObj(hSurface, GDI_OBJECT_TYPE_DD_SURFACE); */ @@ -869,7 +1064,9 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); +#ifdef DX_DEBUG DPRINT1("NtGdiDdGetAvailDriverMemory\n"); +#endif /* backup the orignal PDev and info */ lgpl = puGetAvailDriverMemoryData->lpDD; @@ -901,7 +1098,10 @@ PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW); + +#ifdef DX_DEBUG DPRINT1("NtGdiDdSetExclusiveMode\n"); +#endif /* backup the orignal PDev and info */ lgpl = puSetExclusiveModeData->lpDD;
19 years
1
0
0
0
[cwittich] 20093: better GetSystemPowerStatus stub
by cwittich@svn.reactos.com
better GetSystemPowerStatus stub Modified: trunk/reactos/lib/kernel32/misc/stubs.c _____ Modified: trunk/reactos/lib/kernel32/misc/stubs.c --- trunk/reactos/lib/kernel32/misc/stubs.c 2005-12-11 23:43:37 UTC (rev 20092) +++ trunk/reactos/lib/kernel32/misc/stubs.c 2005-12-11 23:45:44 UTC (rev 20093) @@ -194,7 +194,13 @@ ) { STUB; - return 0; + PowerStatus->ACLineStatus = 1; + PowerStatus->BatteryFlag = 128; + PowerStatus->BatteryLifePercent = 255; + PowerStatus->Reserved1 = 0; + PowerStatus->BatteryLifeTime = -1; + PowerStatus->BatteryFullLifeTime = -1; + return TRUE; }
19 years
1
0
0
0
[navaraf] 20092: Check for failed allocations. Spotted by Martin Bealby.
by navaraf@svn.reactos.com
Check for failed allocations. Spotted by Martin Bealby. Modified: trunk/reactos/lib/rtl/path.c _____ Modified: trunk/reactos/lib/rtl/path.c --- trunk/reactos/lib/rtl/path.c 2005-12-11 23:01:45 UTC (rev 20091) +++ trunk/reactos/lib/rtl/path.c 2005-12-11 23:43:37 UTC (rev 20092) @@ -290,72 +290,6 @@ handle = 0; } - -/* What the heck is this all about??? It looks like its getting the long path, - * and if does, ITS WRONG! If current directory is set with a short path, - * GetCurrentDir should return a short path. - * If anyone agrees with me, remove this stuff. - * -Gunnar - */ -#if 0 - filenameinfo = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - MAX_PATH*sizeof(WCHAR)+sizeof(ULONG)); - - Status = ZwQueryInformationFile(handle, - &iosb, - filenameinfo, - MAX_PATH*sizeof(WCHAR)+sizeof(ULONG), - FileNameInformation); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(RtlGetProcessHeap(), - 0, - filenameinfo); - RtlFreeHeap(RtlGetProcessHeap(), - 0, - buf); - RtlFreeHeap(RtlGetProcessHeap(), - 0, - full.Buffer); - RtlReleasePebLock(); - return(Status); - } - - /* If it's just "\", we need special handling */ - if (filenameinfo->FileNameLength > sizeof(WCHAR)) - { - wcs = buf + size / sizeof(WCHAR) - 1; - if (*wcs == L'\\') - { - *(wcs) = 0; - wcs--; - size -= sizeof(WCHAR); - } - - for (Index = 0; - Index < filenameinfo->FileNameLength / sizeof(WCHAR); - Index++) - { - if (filenameinfo->FileName[Index] == '\\') backslashcount++; - } - - DPRINT("%d \n",backslashcount); - for (;backslashcount;wcs--) - { - if (*wcs=='\\') backslashcount--; - } - wcs++; - - RtlCopyMemory(wcs, filenameinfo->FileName, filenameinfo->FileNameLength); - wcs[filenameinfo->FileNameLength / sizeof(WCHAR)] = 0; - - size = (wcs - buf) * sizeof(WCHAR) + filenameinfo->FileNameLength; - } -#endif - - - if (cd->Handle) ZwClose(cd->Handle); cd->Handle = handle; @@ -547,6 +481,11 @@ val.Length = 0; val.MaximumLength = size; val.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, size); + if (val.Buffer == NULL) + { + reqsize = 0; + goto done; + } switch (RtlQueryEnvironmentVariable_U(NULL, &var, &val)) { @@ -713,6 +652,8 @@ if (reqsize > size) { LPWSTR tmp = RtlAllocateHeap(RtlGetProcessHeap(), 0, reqsize); + if (tmp == NULL) + return 0; reqsize = get_full_path_helper(name, tmp, reqsize); if (reqsize > size) /* it may have worked the second time */ {
19 years
1
0
0
0
[cwittich] 20091: set eol-style:native
by cwittich@svn.reactos.com
set eol-style:native Modified: trunk/reactos/lib/rtl/critical.c _____ Modified: trunk/reactos/lib/rtl/critical.c --- trunk/reactos/lib/rtl/critical.c 2005-12-11 22:40:15 UTC (rev 20090) +++ trunk/reactos/lib/rtl/critical.c 2005-12-11 23:01:45 UTC (rev 20091) @@ -1,676 +1,676 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/rtl/critical.c - * PURPOSE: Critical sections - * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) - * Gunnar Dalsnes - */ - -/* INCLUDES *****************************************************************/ - -#include <rtl.h> - -#define NDEBUG -#include <debug.h> - -#define MAX_STATIC_CS_DEBUG_OBJECTS 64 - -static RTL_CRITICAL_SECTION RtlCriticalSectionLock; -static LIST_ENTRY RtlCriticalSectionList; -static BOOLEAN RtlpCritSectInitialized = FALSE; -static RTL_CRITICAL_SECTION_DEBUG RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS]; -static BOOLEAN RtlpDebugInfoFreeList[MAX_STATIC_CS_DEBUG_OBJECTS]; - -/* FUNCTIONS *****************************************************************/ - -/*++ - * RtlpCreateCriticalSectionSem - * - * Checks if an Event has been created for the critical section. - * - * Params: - * None - * - * Returns: - * None. Raises an exception if the system call failed. - * - * Remarks: - * None - * - *--*/ -VOID -NTAPI -RtlpCreateCriticalSectionSem(PRTL_CRITICAL_SECTION CriticalSection) -{ - HANDLE hEvent = CriticalSection->LockSemaphore; - HANDLE hNewEvent; - NTSTATUS Status; - - /* Chevk if we have an event */ - if (!hEvent) { - - /* No, so create it */ - if (!NT_SUCCESS(Status = NtCreateEvent(&hNewEvent, - EVENT_ALL_ACCESS, - NULL, - SynchronizationEvent, - FALSE))) { - - /* We failed, this is bad... */ - DPRINT1("Failed to Create Event!\n"); - InterlockedDecrement(&CriticalSection->LockCount); - RtlRaiseStatus(Status); - return; - } - DPRINT("Created Event: %p \n", hNewEvent); - - if ((hEvent = InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphor e, - (PVOID)hNewEvent, - 0))) { - - /* Some just created an event */ - DPRINT("Closing already created event: %p\n", hNewEvent); - NtClose(hNewEvent); - } - } - - return; -} - -/*++ - * RtlpWaitForCriticalSection - * - * Slow path of RtlEnterCriticalSection. Waits on an Event Object. - * - * Params: - * CriticalSection - Critical section to acquire. - * - * Returns: - * STATUS_SUCCESS, or raises an exception if a deadlock is occuring. - * - * Remarks: - * None - * - *--*/ -NTSTATUS -NTAPI -RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ - NTSTATUS Status; - EXCEPTION_RECORD ExceptionRecord; - BOOLEAN LastChance = FALSE; - LARGE_INTEGER Timeout; - - /* Wait 2.5 minutes */ - Timeout.QuadPart = 150000L * (ULONGLONG)10000; - Timeout.QuadPart = -Timeout.QuadPart; - /* ^^ HACK HACK HACK. Good way: - Timeout = &NtCurrentPeb()->CriticalSectionTimeout */ - - /* Do we have an Event yet? */ - if (!CriticalSection->LockSemaphore) { - RtlpCreateCriticalSectionSem(CriticalSection); - } - - /* Increase the Debug Entry count */ - DPRINT("Waiting on Critical Section Event: %p %p\n", - CriticalSection, - CriticalSection->LockSemaphore); - CriticalSection->DebugInfo->EntryCount++; - - for (;;) { - - /* Increase the number of times we've had contention */ - CriticalSection->DebugInfo->ContentionCount++; - - /* Wait on the Event */ - Status = NtWaitForSingleObject(CriticalSection->LockSemaphore, - FALSE, - &Timeout); - - /* We have Timed out */ - if (Status == STATUS_TIMEOUT) { - - /* Is this the 2nd time we've timed out? */ - if (LastChance) { - - DPRINT1("Deadlock: %p\n", CriticalSection); - - /* Yes it is, we are raising an exception */ - ExceptionRecord.ExceptionCode = STATUS_POSSIBLE_DEADLOCK; - ExceptionRecord.ExceptionFlags = 0; - ExceptionRecord.ExceptionRecord = NULL; - ExceptionRecord.ExceptionAddress = RtlRaiseException; - ExceptionRecord.NumberParameters = 1; - ExceptionRecord.ExceptionInformation[0] = (ULONG_PTR)CriticalSection; - RtlRaiseException(&ExceptionRecord); - - } - - /* One more try */ - LastChance = TRUE; - - } else { - - /* If we are here, everything went fine */ - return STATUS_SUCCESS; - } - } -} - -/*++ - * RtlpUnWaitCriticalSection - * - * Slow path of RtlLeaveCriticalSection. Fires an Event Object. - * - * Params: - * CriticalSection - Critical section to release. - * - * Returns: - * None. Raises an exception if the system call failed. - * - * Remarks: - * None - * - *--*/ -VOID -NTAPI -RtlpUnWaitCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ - NTSTATUS Status; - - /* Do we have an Event yet? */ - if (!CriticalSection->LockSemaphore) { - RtlpCreateCriticalSectionSem(CriticalSection); - } - - /* Signal the Event */ - DPRINT("Signaling Critical Section Event: %p, %p\n", - CriticalSection, - CriticalSection->LockSemaphore); - Status = NtSetEvent(CriticalSection->LockSemaphore, NULL); - - if (!NT_SUCCESS(Status)) { - - /* We've failed */ - DPRINT1("Signaling Failed for: %p, %p, 0x%08lx\n", - CriticalSection, - CriticalSection->LockSemaphore, - Status); - RtlRaiseStatus(Status); - } -} - -/*++ - * RtlpInitDeferedCriticalSection - * - * Initializes the Critical Section implementation. - * - * Params: - * None - * - * Returns: - * None. - * - * Remarks: - * After this call, the Process Critical Section list is protected. - * - *--*/ -VOID -NTAPI -RtlpInitDeferedCriticalSection(VOID) -{ - - /* Initialize the Process Critical Section List */ - InitializeListHead(&RtlCriticalSectionList); - - /* Initialize the CS Protecting the List */ - RtlInitializeCriticalSection(&RtlCriticalSectionLock); - - /* It's now safe to enter it */ - RtlpCritSectInitialized = TRUE; -} - -/*++ - * RtlpAllocateDebugInfo - * - * Finds or allocates memory for a Critical Section Debug Object - * - * Params: - * None - * - * Returns: - * A pointer to an empty Critical Section Debug Object. - * - * Remarks: - * For optimization purposes, the first 64 entries can be cached. From - * then on, future Critical Sections will allocate memory from the heap. - * - *--*/ -PRTL_CRITICAL_SECTION_DEBUG -NTAPI -RtlpAllocateDebugInfo(VOID) -{ - ULONG i; - - /* Try to allocate from our buffer first */ - for (i = 0; i < MAX_STATIC_CS_DEBUG_OBJECTS; i++) { - - /* Check if Entry is free */ - if (!RtlpDebugInfoFreeList[i]) { - - /* Mark entry in use */ - DPRINT("Using entry: %lu. Buffer: %p\n", i, &RtlpStaticDebugInfo[i]); - RtlpDebugInfoFreeList[i] = TRUE; - - /* Use free entry found */ - return &RtlpStaticDebugInfo[i]; - } - - } - - /* We are out of static buffer, allocate dynamic */ - return RtlAllocateHeap(NtCurrentPeb()->ProcessHeap, - 0, - sizeof(RTL_CRITICAL_SECTION_DEBUG)); -} - -/*++ - * RtlpFreeDebugInfo - * - * Frees the memory for a Critical Section Debug Object - * - * Params: - * DebugInfo - Pointer to Critical Section Debug Object to free. - * - * Returns: - * None. - * - * Remarks: - * If the pointer is part of the static buffer, then the entry is made - * free again. If not, the object is de-allocated from the heap. - * - *--*/ -VOID -NTAPI -RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) -{ - ULONG EntryId; - - /* Is it part of our cached entries? */ - if ((DebugInfo >= RtlpStaticDebugInfo) && - (DebugInfo <= &RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS-1])) { - - /* Yes. zero it out */ - RtlZeroMemory(DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG)); - - /* Mark as free */ - EntryId = (DebugInfo - RtlpStaticDebugInfo); - DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n", - DebugInfo, - EntryId, - NtCurrentTeb()->Cid.UniqueProcess); - RtlpDebugInfoFreeList[EntryId] = FALSE; - - } else { - - /* It's a dynamic one, so free from the heap */ - DPRINT("Freeing from Heap: %p inside Process: %p\n", - DebugInfo, - NtCurrentTeb()->Cid.UniqueProcess); - RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); - - } -} - -/*++ - * RtlDeleteCriticalSection - * @implemented NT4 - * - * Deletes a Critical Section - * - * Params: - * CriticalSection - Critical section to delete. - * - * Returns: - * STATUS_SUCCESS, or error value returned by NtClose. - * - * Remarks: - * The critical section members should not be read after this call. - * - *--*/ -NTSTATUS -NTAPI -RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ - NTSTATUS Status = STATUS_SUCCESS; - - DPRINT("Deleting Critical Section: %p\n", CriticalSection); - /* Close the Event Object Handle if it exists */ - if (CriticalSection->LockSemaphore) { - - /* In case NtClose fails, return the status */ - Status = NtClose(CriticalSection->LockSemaphore); - - } - - /* Protect List */ - RtlEnterCriticalSection(&RtlCriticalSectionLock); - - /* Remove it from the list */ - RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList); - - /* Unprotect */ - RtlLeaveCriticalSection(&RtlCriticalSectionLock); - - /* Free it */ - RtlpFreeDebugInfo(CriticalSection->DebugInfo); - - /* Wipe it out */ - RtlZeroMemory(CriticalSection, sizeof(RTL_CRITICAL_SECTION)); - - /* Return */ - return Status; -} - -/*++ - * RtlSetCriticalSectionSpinCount - * @implemented NT4 - * - * Sets the spin count for a critical section. - * - * Params: - * CriticalSection - Critical section to set the spin count for. - * - * SpinCount - Spin count for the critical section. - * - * Returns: - * STATUS_SUCCESS. - * - * Remarks: - * SpinCount is ignored on single-processor systems. - * - *--*/ -DWORD -NTAPI -RtlSetCriticalSectionSpinCount(PRTL_CRITICAL_SECTION CriticalSection, - ULONG SpinCount) -{ - ULONG OldCount = CriticalSection->SpinCount; - - /* Set to parameter if MP, or to 0 if this is Uniprocessor */ - CriticalSection->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? SpinCount : 0; - return OldCount; -} - -/*++ - * RtlEnterCriticalSection - * @implemented NT4 - * - * Waits to gain ownership of the critical section. - * - * Params: - * CriticalSection - Critical section to wait for. - * - * Returns: - * STATUS_SUCCESS. - * - * Remarks: - * Uses a fast-path unless contention happens. - * - *--*/ -NTSTATUS -NTAPI -RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; - - /* Try to Lock it */ - if (InterlockedIncrement(&CriticalSection->LockCount) != 0) { - - /* - * We've failed to lock it! Does this thread - * actually own it? - */ - if (Thread == CriticalSection->OwningThread) { - - /* You own it, so you'll get it when you're done with it! No need to - use the interlocked functions as only the thread who already owns - the lock can modify this data. */ - CriticalSection->RecursionCount++; - return STATUS_SUCCESS; - } - - /* NOTE - CriticalSection->OwningThread can be NULL here because changing - this information is not serialized. This happens when thread a - acquires the lock (LockCount == 0) and thread b tries to - acquire it as well (LockCount == 1) but thread a hasn't had a - chance to set the OwningThread! So it's not an error when - OwningThread is NULL here! */ - - /* We don't own it, so we must wait for it */ - RtlpWaitForCriticalSection(CriticalSection); - } - - /* Lock successful. Changing this information has not to be serialized because - only one thread at a time can actually change it (the one who acquired - the lock)! */ - CriticalSection->OwningThread = Thread; - CriticalSection->RecursionCount = 1; - return STATUS_SUCCESS; -} - -/*++ - * RtlInitializeCriticalSection - * @implemented NT4 - * - * Initialises a new critical section. - * - * Params: - * CriticalSection - Critical section to initialise - * - * Returns: - * STATUS_SUCCESS. - * - * Remarks: - * Simply calls RtlInitializeCriticalSectionAndSpinCount - * - *--*/ -NTSTATUS -NTAPI -RtlInitializeCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ - /* Call the Main Function */ - return RtlInitializeCriticalSectionAndSpinCount(CriticalSection, 0); -} - -/*++ - * RtlInitializeCriticalSectionAndSpinCount - * @implemented NT4 - * - * Initialises a new critical section. - * - * Params: - * CriticalSection - Critical section to initialise - * - * SpinCount - Spin count for the critical section. - * - * Returns: - * STATUS_SUCCESS. - * - * Remarks: - * SpinCount is ignored on single-processor systems. - * - *--*/ -NTSTATUS -NTAPI -RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection, - ULONG SpinCount) -{ - PRTL_CRITICAL_SECTION_DEBUG CritcalSectionDebugData; - - /* First things first, set up the Object */ - DPRINT("Initializing Critical Section: %p\n", CriticalSection); - CriticalSection->LockCount = -1; - CriticalSection->RecursionCount = 0; - CriticalSection->OwningThread = 0; - CriticalSection->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? SpinCount : 0; - CriticalSection->LockSemaphore = 0; - - /* Allocate the Debug Data */ - CritcalSectionDebugData = RtlpAllocateDebugInfo(); - DPRINT("Allocated Debug Data: %p inside Process: %p\n", - CritcalSectionDebugData, - NtCurrentTeb()->Cid.UniqueProcess); - - if (!CritcalSectionDebugData) { - - /* This is bad! */ - DPRINT1("Couldn't allocate Debug Data for: %p\n", CriticalSection); - return STATUS_NO_MEMORY; - } - - /* Set it up */ - CritcalSectionDebugData->Type = RTL_CRITSECT_TYPE; - CritcalSectionDebugData->ContentionCount = 0; - CritcalSectionDebugData->EntryCount = 0; - CritcalSectionDebugData->CriticalSection = CriticalSection; - CriticalSection->DebugInfo = CritcalSectionDebugData; - - /* - * Add it to the List of Critical Sections owned by the process. - * If we've initialized the Lock, then use it. If not, then probably - * this is the lock initialization itself, so insert it directly. - */ - if ((CriticalSection != &RtlCriticalSectionLock) && (RtlpCritSectInitialized)) { - - DPRINT("Securely Inserting into ProcessLocks: %p, %p, %p\n", - &CritcalSectionDebugData->ProcessLocksList, - CriticalSection, - &RtlCriticalSectionList); - - /* Protect List */ - RtlEnterCriticalSection(&RtlCriticalSectionLock); - - /* Add this one */ - InsertTailList(&RtlCriticalSectionList, &CritcalSectionDebugData->ProcessLocksList); - - /* Unprotect */ - RtlLeaveCriticalSection(&RtlCriticalSectionLock); - - } else { - - DPRINT("Inserting into ProcessLocks: %p, %p, %p\n", - &CritcalSectionDebugData->ProcessLocksList, - CriticalSection, - &RtlCriticalSectionList); - - /* Add it directly */ - InsertTailList(&RtlCriticalSectionList, &CritcalSectionDebugData->ProcessLocksList); - } - - return STATUS_SUCCESS; -} - -/*++ - * RtlLeaveCriticalSection - * @implemented NT4 - * - * Releases a critical section and makes if available for new owners. - * - * Params: - * CriticalSection - Critical section to release. - * - * Returns: - * STATUS_SUCCESS. - * - * Remarks: - * If another thread was waiting, the slow path is entered. - * - *--*/ -NTSTATUS -NTAPI -RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ -#ifndef NDEBUG - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; - - /* In win this case isn't checked. However it's a valid check so it should only - be performed in debug builds! */ - if (Thread != CriticalSection->OwningThread) - { - DPRINT1("Releasing critical section not owned!\n"); - return STATUS_INVALID_PARAMETER; - } -#endif - - /* Decrease the Recursion Count. No need to do this atomically because only - the thread who holds the lock can call this function (unless the program - is totally screwed... */ - if (--CriticalSection->RecursionCount) { - - /* Someone still owns us, but we are free. This needs to be done atomically. */ - InterlockedDecrement(&CriticalSection->LockCount); - - } else { - - /* Nobody owns us anymore. No need to do this atomically. See comment - above. */ - CriticalSection->OwningThread = 0; - - /* Was someone wanting us? This needs to be done atomically. */ - if (-1 != InterlockedDecrement(&CriticalSection->LockCount)) { - - /* Let him have us */ - RtlpUnWaitCriticalSection(CriticalSection); - } - } - - /* Sucessful! */ - return STATUS_SUCCESS; -} - -/*++ - * RtlTryEnterCriticalSection - * @implemented NT4 - * - * Attemps to gain ownership of the critical section without waiting. - * - * Params: - * CriticalSection - Critical section to attempt acquiring. - * - * Returns: - * TRUE if the critical section has been acquired, FALSE otherwise. - * - * Remarks: - * None - * - *--*/ -BOOLEAN -NTAPI -RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -{ - /* Try to take control */ - if (InterlockedCompareExchange(&CriticalSection->LockCount, - 0, - -1) == -1) { - - /* It's ours */ - CriticalSection->OwningThread = NtCurrentTeb()->Cid.UniqueThread; - CriticalSection->RecursionCount = 1; - return TRUE; - - } else if (CriticalSection->OwningThread == NtCurrentTeb()->Cid.UniqueThread) { - - /* It's already ours */ - InterlockedIncrement(&CriticalSection->LockCount); - CriticalSection->RecursionCount++; - return TRUE; - } - - /* It's not ours */ - return FALSE; -} - -/* EOF */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/critical.c + * PURPOSE: Critical sections + * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) + * Gunnar Dalsnes + */ + +/* INCLUDES *****************************************************************/ + +#include <rtl.h> + +#define NDEBUG +#include <debug.h> + +#define MAX_STATIC_CS_DEBUG_OBJECTS 64 + +static RTL_CRITICAL_SECTION RtlCriticalSectionLock; +static LIST_ENTRY RtlCriticalSectionList; +static BOOLEAN RtlpCritSectInitialized = FALSE; +static RTL_CRITICAL_SECTION_DEBUG RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS]; +static BOOLEAN RtlpDebugInfoFreeList[MAX_STATIC_CS_DEBUG_OBJECTS]; + +/* FUNCTIONS *****************************************************************/ + +/*++ + * RtlpCreateCriticalSectionSem + * + * Checks if an Event has been created for the critical section. + * + * Params: + * None + * + * Returns: + * None. Raises an exception if the system call failed. + * + * Remarks: + * None + * + *--*/ +VOID +NTAPI +RtlpCreateCriticalSectionSem(PRTL_CRITICAL_SECTION CriticalSection) +{ + HANDLE hEvent = CriticalSection->LockSemaphore; + HANDLE hNewEvent; + NTSTATUS Status; + + /* Chevk if we have an event */ + if (!hEvent) { + + /* No, so create it */ + if (!NT_SUCCESS(Status = NtCreateEvent(&hNewEvent, + EVENT_ALL_ACCESS, + NULL, + SynchronizationEvent, + FALSE))) { + + /* We failed, this is bad... */ + DPRINT1("Failed to Create Event!\n"); + InterlockedDecrement(&CriticalSection->LockCount); + RtlRaiseStatus(Status); + return; + } + DPRINT("Created Event: %p \n", hNewEvent); + + if ((hEvent = InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphor e, + (PVOID)hNewEvent, + 0))) { + + /* Some just created an event */ + DPRINT("Closing already created event: %p\n", hNewEvent); + NtClose(hNewEvent); + } + } + + return; +} + +/*++ + * RtlpWaitForCriticalSection + * + * Slow path of RtlEnterCriticalSection. Waits on an Event Object. + * + * Params: + * CriticalSection - Critical section to acquire. + * + * Returns: + * STATUS_SUCCESS, or raises an exception if a deadlock is occuring. + * + * Remarks: + * None + * + *--*/ +NTSTATUS +NTAPI +RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +{ + NTSTATUS Status; + EXCEPTION_RECORD ExceptionRecord; + BOOLEAN LastChance = FALSE; + LARGE_INTEGER Timeout; + + /* Wait 2.5 minutes */ + Timeout.QuadPart = 150000L * (ULONGLONG)10000; + Timeout.QuadPart = -Timeout.QuadPart; + /* ^^ HACK HACK HACK. Good way: + Timeout = &NtCurrentPeb()->CriticalSectionTimeout */ + + /* Do we have an Event yet? */ + if (!CriticalSection->LockSemaphore) { + RtlpCreateCriticalSectionSem(CriticalSection); + } + + /* Increase the Debug Entry count */ + DPRINT("Waiting on Critical Section Event: %p %p\n", + CriticalSection, + CriticalSection->LockSemaphore); + CriticalSection->DebugInfo->EntryCount++; + + for (;;) { + + /* Increase the number of times we've had contention */ + CriticalSection->DebugInfo->ContentionCount++; + + /* Wait on the Event */ + Status = NtWaitForSingleObject(CriticalSection->LockSemaphore, + FALSE, + &Timeout); + + /* We have Timed out */ + if (Status == STATUS_TIMEOUT) { + + /* Is this the 2nd time we've timed out? */ + if (LastChance) { + + DPRINT1("Deadlock: %p\n", CriticalSection); + + /* Yes it is, we are raising an exception */ + ExceptionRecord.ExceptionCode = STATUS_POSSIBLE_DEADLOCK; + ExceptionRecord.ExceptionFlags = 0; + ExceptionRecord.ExceptionRecord = NULL; + ExceptionRecord.ExceptionAddress = RtlRaiseException; + ExceptionRecord.NumberParameters = 1; + ExceptionRecord.ExceptionInformation[0] = (ULONG_PTR)CriticalSection; + RtlRaiseException(&ExceptionRecord); + + } + + /* One more try */ + LastChance = TRUE; + + } else { + + /* If we are here, everything went fine */ + return STATUS_SUCCESS; + } + } +} + +/*++ + * RtlpUnWaitCriticalSection + * + * Slow path of RtlLeaveCriticalSection. Fires an Event Object. + * + * Params: + * CriticalSection - Critical section to release. + * + * Returns: + * None. Raises an exception if the system call failed. + * + * Remarks: + * None + * + *--*/ +VOID +NTAPI +RtlpUnWaitCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) +{ + NTSTATUS Status; + + /* Do we have an Event yet? */ + if (!CriticalSection->LockSemaphore) { + RtlpCreateCriticalSectionSem(CriticalSection); + } + + /* Signal the Event */ + DPRINT("Signaling Critical Section Event: %p, %p\n", + CriticalSection, + CriticalSection->LockSemaphore); + Status = NtSetEvent(CriticalSection->LockSemaphore, NULL); + + if (!NT_SUCCESS(Status)) { + + /* We've failed */ + DPRINT1("Signaling Failed for: %p, %p, 0x%08lx\n", + CriticalSection, + CriticalSection->LockSemaphore, + Status); + RtlRaiseStatus(Status); + } +} + +/*++ + * RtlpInitDeferedCriticalSection + * + * Initializes the Critical Section implementation. + * + * Params: + * None + * + * Returns: + * None. + * + * Remarks: + * After this call, the Process Critical Section list is protected. + * + *--*/ +VOID +NTAPI +RtlpInitDeferedCriticalSection(VOID) +{ + + /* Initialize the Process Critical Section List */ + InitializeListHead(&RtlCriticalSectionList); + + /* Initialize the CS Protecting the List */ + RtlInitializeCriticalSection(&RtlCriticalSectionLock); + + /* It's now safe to enter it */ + RtlpCritSectInitialized = TRUE; +} + +/*++ + * RtlpAllocateDebugInfo + * + * Finds or allocates memory for a Critical Section Debug Object + * + * Params: + * None + * + * Returns: + * A pointer to an empty Critical Section Debug Object. + * + * Remarks: + * For optimization purposes, the first 64 entries can be cached. From + * then on, future Critical Sections will allocate memory from the heap. + * + *--*/ +PRTL_CRITICAL_SECTION_DEBUG +NTAPI +RtlpAllocateDebugInfo(VOID) +{ + ULONG i; + + /* Try to allocate from our buffer first */ + for (i = 0; i < MAX_STATIC_CS_DEBUG_OBJECTS; i++) { + + /* Check if Entry is free */ + if (!RtlpDebugInfoFreeList[i]) { + + /* Mark entry in use */ + DPRINT("Using entry: %lu. Buffer: %p\n", i, &RtlpStaticDebugInfo[i]); + RtlpDebugInfoFreeList[i] = TRUE; + + /* Use free entry found */ + return &RtlpStaticDebugInfo[i]; + } + + } + + /* We are out of static buffer, allocate dynamic */ + return RtlAllocateHeap(NtCurrentPeb()->ProcessHeap, + 0, + sizeof(RTL_CRITICAL_SECTION_DEBUG)); +} + +/*++ + * RtlpFreeDebugInfo + * + * Frees the memory for a Critical Section Debug Object + * + * Params: + * DebugInfo - Pointer to Critical Section Debug Object to free. + * + * Returns: + * None. + * + * Remarks: + * If the pointer is part of the static buffer, then the entry is made + * free again. If not, the object is de-allocated from the heap. + * + *--*/ +VOID +NTAPI +RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) +{ + ULONG EntryId; + + /* Is it part of our cached entries? */ + if ((DebugInfo >= RtlpStaticDebugInfo) && + (DebugInfo <= &RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS-1])) { + + /* Yes. zero it out */ + RtlZeroMemory(DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG)); + + /* Mark as free */ + EntryId = (DebugInfo - RtlpStaticDebugInfo); + DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n", + DebugInfo, + EntryId, + NtCurrentTeb()->Cid.UniqueProcess); + RtlpDebugInfoFreeList[EntryId] = FALSE; + + } else { + + /* It's a dynamic one, so free from the heap */ + DPRINT("Freeing from Heap: %p inside Process: %p\n", [truncated at 1000 lines; 361 more skipped]
19 years
1
0
0
0
[navaraf] 20090: Revert r20089, thanks SVN for not a nice conflict resolution!
by navaraf@svn.reactos.com
Revert r20089, thanks SVN for not a nice conflict resolution! Modified: trunk/reactos/lib/kernel32/file/npipe.c _____ Modified: trunk/reactos/lib/kernel32/file/npipe.c --- trunk/reactos/lib/kernel32/file/npipe.c 2005-12-11 22:36:20 UTC (rev 20089) +++ trunk/reactos/lib/kernel32/file/npipe.c 2005-12-11 22:40:15 UTC (rev 20090) @@ -924,11 +924,6 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } - if (UserNameW.Buffer == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } UserNameA.Buffer = lpUserName; UserNameA.Length = 0;
19 years
1
0
0
0
[navaraf] 20089: Check for failed allocation in GetNamedPipeHandleStateA.
by navaraf@svn.reactos.com
Check for failed allocation in GetNamedPipeHandleStateA. Modified: trunk/reactos/lib/kernel32/file/npipe.c _____ Modified: trunk/reactos/lib/kernel32/file/npipe.c --- trunk/reactos/lib/kernel32/file/npipe.c 2005-12-11 22:13:46 UTC (rev 20088) +++ trunk/reactos/lib/kernel32/file/npipe.c 2005-12-11 22:36:20 UTC (rev 20089) @@ -924,6 +924,11 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } + if (UserNameW.Buffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } UserNameA.Buffer = lpUserName; UserNameA.Length = 0;
19 years
1
0
0
0
[weiden] 20088: fixed uninitialized variable warnings and possible buffer overflows when reading strings from the registry that aren't NULL-terminated
by weiden@svn.reactos.com
fixed uninitialized variable warnings and possible buffer overflows when reading strings from the registry that aren't NULL-terminated Modified: trunk/reactos/lib/setupapi/devinst.c _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-12-11 21:29:07 UTC (rev 20087) +++ trunk/reactos/lib/setupapi/devinst.c 2005-12-11 22:13:46 UTC (rev 20088) @@ -1872,13 +1872,14 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto cleanup; } - Buffer[dwLength / sizeof(WCHAR)] = 0; rc = RegQueryValueExW(hClassKey, L"Icon", NULL, NULL, (LPBYTE)Buffer, &dwLength); if (rc != ERROR_SUCCESS) { SetLastError(rc); goto cleanup; } + /* make sure the returned buffer is NULL-terminated */ + Buffer[dwLength / sizeof(WCHAR)] = 0; /* Transform "Icon" value to a INT */ *ImageIndex = atoiW(Buffer); @@ -2065,7 +2066,7 @@ rc = RegQueryValueExW(hKey, L"Installer32", NULL, &dwRegType, NULL, &dwLength); if (rc == ERROR_SUCCESS && dwRegType == REG_SZ) { - Buffer = MyMalloc(dwLength); + Buffer = MyMalloc(dwLength + sizeof(WCHAR)); if (Buffer == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -2077,12 +2078,14 @@ SetLastError(rc); goto cleanup; } + /* make sure the returned buffer is NULL-terminated */ + Buffer[dwLength / sizeof(WCHAR)] = 0; } else if (ERROR_SUCCESS == (rc = RegQueryValueExW(hKey, L"EnumPropPages32", NULL, &dwRegType, NULL, &dwLength)) && dwRegType == REG_SZ) { - Buffer = MyMalloc(dwLength); + Buffer = MyMalloc(dwLength + sizeof(WCHAR)); if (Buffer == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -2094,6 +2097,8 @@ SetLastError(rc); goto cleanup; } + /* make sure the returned buffer is NULL-terminated */ + Buffer[dwLength / sizeof(WCHAR)] = 0; } else { @@ -2108,6 +2113,7 @@ goto cleanup; } *Comma = '\0'; + DllName = Buffer; } else {
19 years
1
0
0
0
[sgasiorek] 20087: merge 20084
by sgasiorek@svn.reactos.com
merge 20084 Added: branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer-pl.rc Modified: branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer_intres .rc _____ Added: branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer-pl.rc --- branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer-pl.rc 2005-12-11 21:24:51 UTC (rev 20086) +++ branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer-pl.rc 2005-12-11 21:29:07 UTC (rev 20087) @@ -0,0 +1,399 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +/////////////////////////////////////////////////////////////////////// ////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include <windows.h> + +/////////////////////////////////////////////////////////////////////// ////// +#undef APSTUDIO_READONLY_SYMBOLS + +/////////////////////////////////////////////////////////////////////// ////// +// Polish (PL) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_POLISH, SUBLANG_NEUTRAL +#pragma code_page(1250) +#endif //_WIN32 + +/////////////////////////////////////////////////////////////////////// ////// +// +// Menu +// + +IDM_MDIFRAME MENU DISCARDABLE +BEGIN + POPUP "&Plik" + BEGIN + MENUITEM "Urucho&m...", ID_EXECUTE + MENUITEM SEPARATOR + MENUITEM "Za&ko±cz", ID_FILE_EXIT + END + POPUP "&Widok" + BEGIN + MENUITEM "Przyciski &standardowe", ID_VIEW_TOOL_BAR + MENUITEM "P&rzyciski dodatkowe", ID_VIEW_EXTRA_BAR + MENUITEM "Pasek &dysk¾w", ID_VIEW_DRIVE_BAR, CHECKED + MENUITEM "Pasek &boczny", ID_VIEW_SIDE_BAR + MENUITEM "Pasek sta&nu", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Od£wie?\tF5", ID_REFRESH + MENUITEM "P&e?ny ekran\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + MENUITEM "SDI", ID_VIEW_SDI + END + POPUP "&Okna" + BEGIN + MENUITEM "Nowe &okno", ID_WINDOW_NEW + MENUITEM "&Kaskada\tShift+F5", ID_WINDOW_CASCADE + MENUITEM "&S?siaduj?co poziomo", ID_WINDOW_TILE_HORZ + MENUITEM "S?siaduj?co &pionowo\tShift+F4", ID_WINDOW_TILE_VERT + MENUITEM "&Autorozmieszczenie", ID_WINDOW_AUTOSORT + MENUITEM "Rozmie£µ wed?ug &nazwy", ID_WINDOW_ARRANGE + END + POPUP "&NarzÛdzia" + BEGIN + MENUITEM "&Opcje", ID_TOOLS_OPTIONS + END + POPUP "Pomo&c" + BEGIN + MENUITEM "Explorer &FAQ", ID_EXPLORER_FAQ + MENUITEM "ReactOS Explorer - &Informacje", ID_ABOUT_EXPLORER + MENUITEM "ReactOS - I&nformacje", ID_ABOUT_WINDOWS + END +END + +IDM_DESKTOPBAR MENU DISCARDABLE +BEGIN + POPUP "" + BEGIN + MENUITEM "&W?a£ciwo£ci", ID_DESKTOPBAR_SETTINGS + MENUITEM "Mened?er &zada±", ID_TASKMGR + MENUITEM SEPARATOR + MENUITEM "ReactOS Explorer - &Informacje", ID_ABOUT_EXPLORER + END +END + +IDM_VOLUME MENU DISCARDABLE +BEGIN + POPUP "" + BEGIN + MENUITEM "&Otw¾rz regulacje g?o£no£ci", ID_TRAY_VOLUME + MENUITEM "&Ustaw w?a£ciwo£ci audio", ID_VOLUME_PROPERTIES + END +END + +IDM_NOTIFYAREA MENU DISCARDABLE +BEGIN + POPUP "" + BEGIN + MENUITEM "&Poka? ukryte ikony", ID_SHOW_HIDDEN_ICONS + MENUITEM "&Ukrywaj nieu?ywane ikony", ID_SHOW_ICON_BUTTON + MENUITEM "&Konfiguruj powiadomienia", ID_CONFIG_NOTIFYAREA + MENUITEM "Ustaw &datÛ/godzinÛ", ID_CONFIG_TIME + MENUITEM SEPARATOR + MENUITEM "ReactOS Explorer - &Informacje", ID_ABOUT_EXPLORER + END +END + +IDM_SDIFRAME MENU DISCARDABLE +BEGIN + POPUP "&Plik" + BEGIN + MENUITEM "Urucho&m...", ID_EXECUTE + MENUITEM SEPARATOR + MENUITEM "Za&ko±cz", ID_FILE_EXIT + END + POPUP "&Widok" + BEGIN + MENUITEM "Przyciski &standardowe", ID_VIEW_TOOL_BAR + MENUITEM "Pasek &boczny", ID_VIEW_SIDE_BAR, GRAYED + MENUITEM "Pasek sta&nu", ID_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Od£wie?\tF5", ID_REFRESH + MENUITEM "P&e?ny ekran\tCtrl+Shift+S", ID_VIEW_FULLSCREEN + MENUITEM "&MDI", ID_VIEW_MDI + END + POPUP "&NarzÛdzia" + BEGIN + MENUITEM "&Opcje", ID_TOOLS_OPTIONS + END + POPUP "Pomo&c" + BEGIN + MENUITEM "Explorer &FAQ", ID_EXPLORER_FAQ + MENUITEM "ReactOS Explorer - &Informacje", ID_ABOUT_EXPLORER + MENUITEM "ReactOS - I&nformacje", ID_ABOUT_WINDOWS + END +END + + +/////////////////////////////////////////////////////////////////////// ////// +// +// Dialog +// + +IDD_EXECUTE DIALOG DISCARDABLE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Uruchom" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,150,10 + CONTROL "&Polecenie:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3, + 18,60,10 + EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL + CONTROL "Jako &symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3, + 45,71,12 + DEFPUSHBUTTON "&OK",1,158,6,47,14 + PUSHBUTTON "&Anuluj",2,158,23,47,14 + PUSHBUTTON "Pomo&c",254,158,43,47,14 +END + +IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_APPWINDOW +CAPTION "Szukaj programu w menu start" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + LTEXT "&Filtry:",IDC_STATIC,7,9,18,8 + EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + WS_TABSTOP,7,25,186,33 + PUSHBUTTON "&Szukaj nazwy",IDC_CHECK_ENTRIES,143,7,50,14 +END + +IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 194 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "W?a£ciwo£ci pulpitu" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Wybierz spos¾b uk?adania ikon:", + IDC_STATIC,7,7,166,8 + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,7,25,46,44 + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,57,25,46,44 + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,110,25,46,44 + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,159,25,46,44 + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,7,73,46,44 + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,57,73,46,44 + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,110,73,46,44 + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,159,73,46,44 + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,7,121,46,44 + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,57,121,46,44 + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + BS_BOTTOM | WS_TABSTOP,110,121,46,44 + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + WS_TABSTOP,159,121,46,44 + CONTROL "Wy£wietlaj &numer wersji",ID_DESKTOP_VERSION,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 +END + +IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 194 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "W?a£ciwo£ci paska zada±" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Poka? &zegar",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,152,52,10 + CONTROL "&Ukrywaj nieaktywne ikony", + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,174,111,10 + PUSHBUTTON "&Dostosuj",ID_CONFIG_NOTIFYAREA,153,173,50,14 +END + +IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 194 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "W?a£ciwo£ci Menu Start" +FONT 8, "MS Sans Serif" +BEGIN +END + +IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_APPWINDOW +CAPTION "Konfiguracja ikon powiadomie±" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 + LTEXT "&Podpowiedf:",IDC_LABEL1,7,44,40,8 + EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL + LTEXT "&Tytu? okna:",IDC_LABEL2,7,63,44,8 + EDITTEXT IDC_NOTIFY_TITLE,58,60,143,14,ES_AUTOHSCROLL + LTEXT "îcie?ka:",IDC_LABEL3,7,81,43,8 + EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL + GROUPBOX "&Spos¾b wy£wietlania",IDC_LABEL4,7,96,157,28 + CONTROL "&widoczny",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + WS_TABSTOP,15,108,33,10 + CONTROL "&ukryty",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, + 108,29,10 + CONTROL "&autoukrywanie",IDC_NOTIFY_AUTOHIDE,"Button", + BS_AUTORADIOBUTTON,112,108,43,10 + ICON "",IDC_PICTURE,173,101,21,20 + LTEXT "&Zmodyfikowany:",IDC_LABEL6,7,132,43,8 + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + ES_READONLY + CONTROL "Po&ka? wszystkie",ID_SHOW_HIDDEN_ICONS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 + DEFPUSHBUTTON "&OK",IDOK,91,153,50,14,WS_GROUP + PUSHBUTTON "&Anuluj",IDCANCEL,151,153,50,14 +END + +IDD_MDI_SDI DIALOGEX 0, 0, 194, 157 +STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Tryb wy£wietlania okien" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + LTEXT "Wybierz tryb wy£wietlania okien:", + IDC_STATIC,7,7,160,8 + CONTROL "&MDI (Otwieraj w jednym oknie)",IDC_MDI,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,124,10 + CONTROL "&SDI (Otwieraj we w?asnym oknie)",IDC_SDI,"Button", + BS_AUTORADIOBUTTON,7,62,118,10 + CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 + CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 + CONTROL "&Otwieraj podkatalogi w nowych oknach", + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,90,135,10 + LTEXT "Te opcje bÛd? stosowane w przysz?o£ci do wszystkich okien.", + IDC_STATIC,7,111,174,22 + DEFPUSHBUTTON "&OK",IDOK,29,136,50,14,WS_GROUP + PUSHBUTTON "&Anuluj",IDCANCEL,106,136,50,14 +END + +IDD_ABOUT_EXPLORER DIALOG DISCARDABLE 0, 0, 199, 106 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS Explorer - &Informacje" +FONT 10, "MS Sans Serif" +BEGIN + LTEXT "ReactOS Explorer",IDC_ROS_EXPLORER,91,13,104,11 + LTEXT "V 0.9",IDC_VERSION_TXT,91,27,104,8 + LTEXT "(c) 2003-2005 Martin Fuchs",IDC_STATIC,91,42,104,8 + LTEXT "",IDC_WIN_VERSION,91,58,98,22 + LTEXT "
http://www.sky.franken.de/explorer/
",IDC_WWW,17,84,129, + 8 + CONTROL "&OK",IDOK,"Button",BS_OWNERDRAW | BS_FLAT | WS_GROUP, + 154,90,38,12 +END + + +#ifdef APSTUDIO_INVOKED +/////////////////////////////////////////////////////////////////////// ////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE MOVEABLE PURE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE MOVEABLE PURE +BEGIN + "#include <windows.h>\r\n" + "\0" +END + +3 TEXTINCLUDE MOVEABLE PURE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +/////////////////////////////////////////////////////////////////////// ////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE "Reactos Explorer" + IDS_START "Start" + IDS_LOGOFF "Wyloguj..." + IDS_SHUTDOWN "Zamknij system..." + IDS_LAUNCH "Uruchom..." + IDS_START_HELP "Pomoc" + IDS_SEARCH_FILES "Szukaj..." + IDS_DOCUMENTS "Dokumenty" + IDS_FAVORITES "Ulubione" + IDS_PROGRAMS "Programy" + IDS_SETTINGS "Ustawienia" + IDS_EXPLORE "Eksploruj" + IDS_EMPTY "(pusty)" + IDS_RECENT "Ostatnio otwarte" + IDS_ADMIN "Administracja" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STARTMENU "Menu start" + IDS_MINIMIZE_ALL "Minimalizuj wszystko" + IDS_DESKTOP_NUM "Pulpit %d" + IDS_VOLUME "G?o£no£µ" + IDS_ITEMS_CUR "Aktualne pozycje" + IDS_ITEMS_CONFIGURED "ustawienia" + IDS_ITEMS_VISIBLE "widoczne" + IDS_ITEMS_HIDDEN "ukryte" + IDS_NOTIFY_SHOW "poka?" + IDS_NOTIFY_HIDE "ukryj" + IDS_NOTIFY_AUTOHIDE "autoukrywanie" + IDS_SHOW_HIDDEN_ICONS "Poka? ukryte ikony" + IDS_HIDE_ICONS "Ukryj ikony" + IDS_TERMINATE "Zako±cz dzia?anie ROS Explorer" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NETWORK "Sieµ" + IDS_CONNECTIONS "Po??czenia sieciowe" + IDS_DRIVES "Dysk" + IDS_SEARCH_COMPUTER "Znajdf komputar..." + IDS_SETTINGS_MENU "Settings menu" + IDS_CONTROL_PANEL "Panel sterowania" + IDS_PRINTERS "Drukarki" + IDS_BROWSE "Przegl?daj" + IDS_SEARCH_PRG "Znajdf progarm..." + IDS_ALL_USERS "All Users\\" + IDS_SEARCH "Szukaj" + IDS_ABOUT_EXPLORER "ReactOS Explorer - &Informacje" + IDS_LAUNCH_MANY_PROGRAMS + "Zaznaczy?e£ wiÛcej ni? jeden program.\nCzy chcesz uruchomiµ je jednocze£nie?" + IDS_DESKTOPBAR_SETTINGS "W?a£ciwo£ci pulpitu" + IDS_DESKTOP "Pulpit" + IDS_TASKBAR "Pasek zada±" +END + +#endif // Polish (PL) resources +/////////////////////////////////////////////////////////////////////// ////// + + + +#ifndef APSTUDIO_INVOKED +/////////////////////////////////////////////////////////////////////// ////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +/////////////////////////////////////////////////////////////////////// ////// +#endif // not APSTUDIO_INVOKED + _____ Modified: branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer_intres .rc --- branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer_intres .rc 2005-12-11 21:24:51 UTC (rev 20086) +++ branches/ros-branch-0_2_9/reactos/subsys/system/explorer/explorer_intres .rc 2005-12-11 21:29:07 UTC (rev 20087) @@ -110,6 +110,7 @@ "#include ""explorer-de.rc""\r\n" "#include ""explorer-es.rc""\r\n" "#include ""explorer-sv.rc""\r\n" + "#include ""explorer-pl.rc""\r\n" "#include ""explorer-pt.rc""\r\n" "#include ""explorer-cz.rc""\r\n" "#include ""explorer-ro.rc""\r\n" @@ -196,6 +197,7 @@ #include "explorer-de.rc" #include "explorer-es.rc" #include "explorer-sv.rc" +#include "explorer-pl.rc" #include "explorer-pt.rc" #include "explorer-cz.rc" #include "explorer-ro.rc"
19 years
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200