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
2024
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
May 2011
----- 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
26 participants
511 discussions
Start a n
N
ew thread
[gschneider] 51811: [msconfig/freeldr] - Load freeldr.ini first chance, boot.ini on second chance - Make freeldr list box scrollable - Fix some FIXME's [msgconfig/system] - Implement parsing and di...
by gschneider@svn.reactos.org
Author: gschneider Date: Tue May 17 18:32:51 2011 New Revision: 51811 URL:
http://svn.reactos.org/svn/reactos?rev=51811&view=rev
Log: [msconfig/freeldr] - Load freeldr.ini first chance, boot.ini on second chance - Make freeldr list box scrollable - Fix some FIXME's [msgconfig/system] - Implement parsing and displaying system.ini contents See issue #1986 for more details. Modified: trunk/reactos/base/applications/msconfig/freeldrpage.c trunk/reactos/base/applications/msconfig/lang/bg-BG.rc trunk/reactos/base/applications/msconfig/lang/ca-ES.rc trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc trunk/reactos/base/applications/msconfig/lang/de-DE.rc trunk/reactos/base/applications/msconfig/lang/el-GR.rc trunk/reactos/base/applications/msconfig/lang/en-US.rc trunk/reactos/base/applications/msconfig/lang/es-ES.rc trunk/reactos/base/applications/msconfig/lang/fr-FR.rc trunk/reactos/base/applications/msconfig/lang/hu-HU.rc trunk/reactos/base/applications/msconfig/lang/id-ID.rc trunk/reactos/base/applications/msconfig/lang/it-IT.rc trunk/reactos/base/applications/msconfig/lang/ko-KR.rc trunk/reactos/base/applications/msconfig/lang/nl-NL.rc trunk/reactos/base/applications/msconfig/lang/no-NO.rc trunk/reactos/base/applications/msconfig/lang/pl-PL.rc trunk/reactos/base/applications/msconfig/lang/pt-BR.rc trunk/reactos/base/applications/msconfig/lang/ro-RO.rc trunk/reactos/base/applications/msconfig/lang/ru-RU.rc trunk/reactos/base/applications/msconfig/lang/sk-SK.rc trunk/reactos/base/applications/msconfig/lang/sv-SE.rc trunk/reactos/base/applications/msconfig/lang/th-TH.rc trunk/reactos/base/applications/msconfig/lang/uk-UA.rc trunk/reactos/base/applications/msconfig/lang/zh-CN.rc trunk/reactos/base/applications/msconfig/systempage.c Modified: trunk/reactos/base/applications/msconfig/freeldrpage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/freeldrpage.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/freeldrpage.c [iso-8859-1] Tue May 17 18:32:51 2011 @@ -1,10 +1,10 @@ /* * PROJECT: ReactOS Applications * LICENSE: LGPL - See COPYING in the top level directory - * FILE: base/applications/freeldrpage.c + * FILE: base/applications/msconfig/freeldrpage.c * PURPOSE: Freeloader configuration page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> - * + * 2011 Gregor Schneider <Gregor.Schneider(a)reactos.org> */ #include <precomp.h> @@ -23,100 +23,111 @@ static FREELDR_SETTINGS Settings = { 0, { 0, }, 0, 0, FALSE }; +#define BUFFER_SIZE 512 -BOOL -LoadBootIni(WCHAR * szDrive, HWND hDlg) +static BOOL +LoadBootIni(WCHAR *szDrive, HWND hDlg) { - WCHAR szBuffer[512]; - HWND hDlgCtrl; - FILE * file; - UINT length; - LRESULT pos; + WCHAR szBuffer[BUFFER_SIZE]; + HWND hDlgCtrl; + FILE * file; + UINT length; + LRESULT pos; - wcscpy(szBuffer, szDrive); - wcscat(szBuffer, L"boot.ini"); - - file = _wfopen(szBuffer, L"rt"); - if (!file) - return FALSE; - - hDlgCtrl = GetDlgItem(hDlg, IDC_LIST_BOX); + wcscpy(szBuffer, szDrive); + wcscat(szBuffer, L"freeldr.ini"); - while(!feof(file)) - { - if (fgetws(szBuffer, sizeof(szBuffer) / sizeof(WCHAR), file)) + file = _wfopen(szBuffer, L"rt"); + if (!file) + { + wcscpy(szBuffer, szDrive); + wcscat(szBuffer, L"boot.ini"); + file = _wfopen(szBuffer, L"rt"); + if (!file) + return FALSE; + } + + hDlgCtrl = GetDlgItem(hDlg, IDC_LIST_BOX); + + while(!feof(file)) + { + if (fgetws(szBuffer, BUFFER_SIZE, file)) { length = wcslen(szBuffer); - while(szBuffer[length] < 14) //FIXME remove line feeds - szBuffer[length--] = 0; + if (length > 1) + { + szBuffer[length] = L'\0'; + szBuffer[length - 1] = L'\0'; - pos = SendMessageW(hDlgCtrl, LB_ADDSTRING, 0, (LPARAM)szBuffer); + pos = SendMessageW(hDlgCtrl, LB_ADDSTRING, 0, (LPARAM)szBuffer); + if (szBuffer[0] == L'[') + continue; - if (szBuffer[0] == L'[') - continue; + if (!wcsncmp(szBuffer, L"timeout=", 8)) + { + Settings.TimeOut = _wtoi(&szBuffer[8]); + continue; + } - if (!wcsncmp(szBuffer, L"timeout=", 8)) - { - Settings.TimeOut = _wtoi(&szBuffer[8]); - continue; + if (!wcsncmp(szBuffer, L"default=", 8)) + { + wcscpy(Settings.szDefaultOS, &szBuffer[8]); + continue; + } + if (pos != LB_ERR) + SendMessage(hDlgCtrl, LB_SETITEMDATA, pos, 1); // indicate that this item is an boot entry + Settings.OSConfigurationCount++; } + } + } - if (!wcsncmp(szBuffer, L"default=", 8)) - { - wcscpy(Settings.szDefaultOS, &szBuffer[8]); - continue; - } - if (pos != LB_ERR) - SendMessage(hDlgCtrl, LB_SETITEMDATA, pos, 1); // indicate that this item is an boot entry - Settings.OSConfigurationCount++; - } - } + fclose(file); + Settings.UseBootIni = TRUE; - fclose(file); - Settings.UseBootIni = TRUE; - - pos = SendMessageW(hDlgCtrl, LB_FINDSTRING, 3, (LPARAM)Settings.szDefaultOS); - if (pos != LB_ERR) - { + pos = SendMessageW(hDlgCtrl, LB_FINDSTRING, 3, (LPARAM)Settings.szDefaultOS); + if (pos != LB_ERR) + { Settings.szDefaultPos = pos; SendMessage(hDlgCtrl, LB_SETCURSEL, pos, 0); - } + } - SetDlgItemInt(hDlg, IDC_TXT_BOOT_TIMEOUT, Settings.TimeOut, FALSE); - if (Settings.OSConfigurationCount < 2) - { + SetDlgItemInt(hDlg, IDC_TXT_BOOT_TIMEOUT, Settings.TimeOut, FALSE); + if (Settings.OSConfigurationCount < 2) + { EnableWindow(GetDlgItem(hDlg, IDC_BTN_SET_DEFAULT_BOOT), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_BTN_MOVE_UP_BOOT_OPTION), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_BTN_MOVE_DOWN_BOOT_OPTION), FALSE); - } - return TRUE; + } + return TRUE; } +static BOOL +InitializeFreeLDRDialog(HWND hDlg) +{ + WCHAR winDir[PATH_MAX]; + WCHAR* ptr = NULL; -BOOL -InitializeDialog(HWND hDlg) -{ - // FIXME - // find real boot drive and handle freeldr configuration ini - return LoadBootIni(L"C:\\", hDlg); + GetWindowsDirectoryW(winDir, PATH_MAX); + ptr = wcschr(winDir, L'\\'); + if (ptr == NULL) + { + return FALSE; + } + ptr[1] = L'\0'; + return LoadBootIni(winDir, hDlg); } - - INT_PTR CALLBACK FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { LRESULT pos; - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); - switch (message) { case WM_INITDIALOG: hFreeLdrDialog = hDlg; SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); - InitializeDialog(hDlg); + InitializeFreeLDRDialog(hDlg); return TRUE; case WM_COMMAND: switch(HIWORD(wParam)) Modified: trunk/reactos/base/applications/msconfig/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/bg-BG.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -78,7 +78,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Ïðîâåðêà íà âñè÷êè ïóñêîâè ïúòèùà", IDC_BTN_CHECK_BOOT_PATH, 5, 65, 129, 12 PUSHBUTTON "&Íàïðàâè ïîäðàçáðàíî", IDC_BTN_SET_DEFAULT_BOOT, 135, 65, 78, 12 PUSHBUTTON "Ïðåìåñòè íà&ãîðå", IDC_BTN_MOVE_UP_BOOT_OPTION, 213, 65, 66, 12 Modified: trunk/reactos/base/applications/msconfig/lang/ca-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/ca-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/ca-ES.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Prova camins d'arrencada", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Fes-ho per defecte", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "P&uja", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/cs-CZ.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -83,7 +83,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Kontrola cest sputìní", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 77, 12 PUSHBUTTON "&Nastavit jako výchozí", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 75, 12 PUSHBUTTON "Posunout N&ahoru", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/de-DE.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -78,7 +78,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Alle Bootpfade überprüfen", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 90, 12 PUSHBUTTON "A&ls Standard", IDC_BTN_SET_DEFAULT_BOOT, 120, 65, 63, 12 PUSHBUTTON "Nach &oben", IDC_BTN_MOVE_UP_BOOT_OPTION, 203, 65, 63, 12 Modified: trunk/reactos/base/applications/msconfig/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/el-GR.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Check All Boot Paths", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Set as Default", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Move &Up", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/en-US.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Check All Boot Paths", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Set as Default", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Move &Up", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/es-ES.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Verificar las rutas de Arranque", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 110, 12 PUSHBUTTON "&Configurar por Defecto", IDC_BTN_SET_DEFAULT_BOOT, 130, 65, 80, 12 PUSHBUTTON "Mover &Arriba", IDC_BTN_MOVE_UP_BOOT_OPTION, 220, 65, 60, 12 Modified: trunk/reactos/base/applications/msconfig/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/fr-FR.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Vérifier les chemins de démarrage", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Par Défaut", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "&Monter", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/hu-HU.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -79,7 +79,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Check All Boot Paths", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Set as Default", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Move &Up", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/id-ID.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/id-ID.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "Periksa Se&mua Path Boot", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Set sebagai Standar", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "&Naik", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/it-IT.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 3, 2, 354, 58, 0x00000200 + LISTBOX IDC_LIST_BOX, 3, 2, 354, 58, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "Ve&rifica percorsi di avvio", IDC_BTN_CHECK_BOOT_PATH, 3, 64, 85, 14 PUSHBUTTON "&Imposta come predefinito", IDC_BTN_SET_DEFAULT_BOOT, 93, 64, 85, 14 PUSHBUTTON "&Sposta su", IDC_BTN_MOVE_UP_BOOT_OPTION, 183, 64, 85, 14 Modified: trunk/reactos/base/applications/msconfig/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/ko-KR.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -80,7 +80,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "¸ðµç ºÎÆðæ·Î Á¡°Ë(&C)", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "±âº»°ªÀ¸·Î ¼³Á¤(&S)", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "À§·Î ¿òÁ÷À̱â(&U)", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/nl-NL.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -97,7 +97,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Alle opstartpaden controleren", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "Als stan&daard instellen", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "&Omhoog", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/no-NO.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Sjekk oppstartsbaner", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 75, 12 PUSHBUTTON "&Sett som standard", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Flytt &opp", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/pl-PL.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -83,7 +83,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Sprawd wszystkie cie¿ki rozruchu", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Ustaw jako domylne", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Przenie w &górê", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/pt-BR.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -83,7 +83,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "Verificar camin&hos de inicialização", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Definir como padrão", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Mo&ver para cima", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/ro-RO.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -77,7 +77,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Verificare toate cãile de pornire", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Setare implicit", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "În &sus", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/ru-RU.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -79,7 +79,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Ïðîâåðèòü âñå ïóòè çàãðóçêè", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 110, 12 PUSHBUTTON "Ï&î óìîë÷àíèþ", IDC_BTN_SET_DEFAULT_BOOT, 125, 65, 70, 12 PUSHBUTTON "&Ââåðõ", IDC_BTN_MOVE_UP_BOOT_OPTION, 200, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/sk-SK.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -81,7 +81,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "S&kontrolova vetky cesty zavedenia", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 130, 12 PUSHBUTTON "&Predvoli", IDC_BTN_SET_DEFAULT_BOOT, 145, 65, 60, 12 PUSHBUTTON "Posunú na&hor", IDC_BTN_MOVE_UP_BOOT_OPTION, 210, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/sv-SE.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -83,7 +83,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Undersök alla bootvägar", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 75, 12 PUSHBUTTON "&Sätt som standard", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "Flytta &upp", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/th-TH.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/th-TH.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/th-TH.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -97,7 +97,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&µÃǨ¡ÒûÅØ¡à¤Ã×èͧ·Ø¡àÊé¹·Ò§", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&µÑ駤èÒâ´Â»ÃÔÂÒÂ", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "à¤Å×è͹·Õè &¢Öé¹", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/uk-UA.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -85,7 +85,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Âèáðàòè âñ³ øëÿõè", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Âñòàíîâèòè ñòàíäàðòíî", IDC_BTN_SET_DEFAULT_BOOT, 92, 65, 88, 12 PUSHBUTTON "Ïåðåì³ñòèòè Ââ&åðõ", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/lang/zh-CN.rc [iso-8859-1] Tue May 17 18:32:51 2011 @@ -97,7 +97,7 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "¼ì²éËùÓÐÆô¶¯Â·¾¶(&C)", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 80, 12 PUSHBUTTON "ÉèΪĬÈÏ(&S)", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "ÉÏÒÆ(&U)", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 Modified: trunk/reactos/base/applications/msconfig/systempage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/systempage.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/systempage.c [iso-8859-1] Tue May 17 18:32:51 2011 @@ -1,15 +1,80 @@ /* * PROJECT: ReactOS Applications * LICENSE: LGPL - See COPYING in the top level directory - * FILE: base/applications/systempage.c + * FILE: base/applications/msconfig/systempage.c * PURPOSE: System page message handler * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph(a)ApiViewer.de> - * + * 2011 Gregor Schneider <Gregor.Schneider(a)reactos.org> */ #include <precomp.h> HWND hSystemPage; HWND hSystemDialog; + +#define BUFFER_SIZE 512 + +static BOOL +LoadSystemIni(WCHAR * szPath, HWND hDlg) +{ + WCHAR szBuffer[BUFFER_SIZE]; + HWND hDlgCtrl; + HTREEITEM parent = NULL; + FILE* file; + UINT length; + TVINSERTSTRUCT insert; + + wcscpy(szBuffer, szPath); + wcscat(szBuffer, L"\\system.ini"); + + file = _wfopen(szBuffer, L"rt"); + if (!file) + return FALSE; + + hDlgCtrl = GetDlgItem(hDlg, IDC_SYSTEM_TREE); + + while(!feof(file)) + { + if (fgetws(szBuffer, BUFFER_SIZE, file)) + { + length = wcslen(szBuffer); + if (length > 1) + { + szBuffer[length] = L'\0'; + szBuffer[length - 1] = L'\0'; + insert.hInsertAfter = TVI_LAST; + insert.item.mask = TVIF_TEXT; + insert.item.pszText = szBuffer; + + if (szBuffer[0] == L';' || szBuffer[0] == L'[') + { + /* Parent */ + insert.hParent = NULL; + parent = TreeView_InsertItem(hDlgCtrl, &insert); + } + else + { + /* Child */ + insert.hParent = parent; + TreeView_InsertItem(hDlgCtrl, &insert); + } + } + } + } + + fclose(file); + + return TRUE; +} + +static BOOL +InitializeSystemDialog(HWND hDlg) +{ + WCHAR winDir[PATH_MAX]; + + GetWindowsDirectoryW(winDir, PATH_MAX); + return LoadSystemIni(winDir, hDlg); +} + INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) @@ -21,6 +86,7 @@ { hSystemDialog = hDlg; SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); + InitializeSystemDialog(hDlg); return TRUE; } }
13 years, 6 months
1
0
0
0
[tkreuzer] 51810: [GDI FONT DRIVER] - Fix buffer size for EngMultiByteToUnicodeN - Fix calculation of the checksum for the 'head' true type table
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue May 17 14:02:44 2011 New Revision: 51810 URL:
http://svn.reactos.org/svn/reactos?rev=51810&view=rev
Log: [GDI FONT DRIVER] - Fix buffer size for EngMultiByteToUnicodeN - Fix calculation of the checksum for the 'head' true type table Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/todo.txt branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/font.c [iso-8859-1] Tue May 17 14:02:44 2011 @@ -225,19 +225,19 @@ /* Convert names to unicode */ EngMultiByteToUnicodeN(pifiex->awcFamilyName, - LF_FACESIZE, + sizeof(pifiex->awcFamilyName), NULL, ftface->family_name, strnlen(ftface->family_name, MAX_PATH)); EngMultiByteToUnicodeN(pifiex->awcStyleName, - LF_FACESIZE, + sizeof(pifiex->awcStyleName), NULL, ftface->style_name, strnlen(ftface->style_name, MAX_PATH)); EngMultiByteToUnicodeN(pifiex->awcFaceName, - LF_FACESIZE, + sizeof(pifiex->awcFaceName), NULL, ftface->family_name, strnlen(ftface->family_name, MAX_PATH)); @@ -249,7 +249,7 @@ pifiex->awcUniqueName[2] = L'0' + (LOWORD(pface->ulFontRevision) / 100) % 10; pifiex->awcUniqueName[3] = L'0' + (LOWORD(pface->ulFontRevision) / 10) % 10; pifiex->awcUniqueName[4] = L'0' + LOWORD(pface->ulFontRevision) % 10; - EngMultiByteToUnicodeN(pifiex->awcUniqueName+6, 4, NULL, pifi->achVendId, 4); + EngMultiByteToUnicodeN(pifiex->awcUniqueName+6, 8, NULL, pifi->achVendId, 4); //__debugbreak(); return TRUE; Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/todo.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/todo.txt [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/todo.txt [iso-8859-1] Tue May 17 14:02:44 2011 @@ -15,7 +15,6 @@ - FtfdQueryFontCaps: 100% done - FtfdQueryTrueTypeTable: 100% done - FtfdGetTrueTypeFile: 100% done - - FtfdQueryFontData: 10%, depends on FtfdLoadGlyph - QFD_MAXEXTENTS: dependes on FtfdQueryMaxExtents - QFD_GLYPHANDBITMAP: depends on FtfdQueryGlyphData, FtfdQueryGlyphBits @@ -33,11 +32,20 @@ ------------------- - FtfdInitIfiMetrics: 80% done - handle other font types than TTF/OTF - - fix fwdLowestPPEm, fwdMacLineGap, ptlBaseline, ptlAspect, ptlCaret - - cKerningPairs from atmfd is bigger, ulPanoseCulture - - check fwdMacAscender, fwdMacDescender - - Check jWinPitchandFamily (from OS/2 table, Apolonia: 0,0->0x12) - - fix fwdUnderscorePosition + - dpwszFamilyName, dpwszStyleName, dpwszFaceName: locale + - dpwszUniqueName: get from 'name' table + - dpFontSim: implement + - dpCharSets: implement + - fwdMacLineGap: implement + - fwdMaxCharInc: check/fix + - fwdCapHeight: check/fix + - fwdUnderscorePosition: fix + - chFirstChar, chLastChar, chDefaultChar, chBreakChar: fix + - wcDefaultChar, wcBreakChar: fix + - ptlBaseline: fix + - ptlAspect: fix + - ptlCaret: fix + - jWinPitchandFamily: check, improve (Apolonia: 0,0->0x12) - FtfdInitGlyphSet: 100% done - FtfdInitKerningPairs: 90% done @@ -55,12 +63,17 @@ - handle vertical layout - handle ptqD for rotation / skewing -- FtfdQueryGlyphBits: 50% depends on FtfdCopyBitmap4Bpp and FtfdCopyBitmap1Bpp - - handle 1bpp bitmaps +- FtfdQueryGlyphBits: 90% depends on FtfdCopyBitmap4Bpp and FtfdCopyBitmap1Bpp - FtfdQueryGlyphOutline: unimplemented - FtfdCopyBitmap4Bpp: 90 % - add rounding - Could need optimization -- FtfdCopyBitmap1Bpp: unimplemented +- FtfdCopyBitmap1Bpp: 90 % + - Can we use full memcpy? +When replacing the original ttf driver +----------------------------------------------- +- Horizontal metrics are broken +- Marlett symbols are wrong + Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/tttables.c [iso-8859-1] Tue May 17 14:02:44 2011 @@ -121,8 +121,18 @@ return NULL; } - /* Check the table's checksum */ + /* Calculate the table's checksum */ ulCheckSum = CalcTableChecksum((PUCHAR)pvView + ulOffset, ulLength); + + /* Special fixup for 'head' table */ + if (ulTag == 'daeh') + { + /* Substract checkSumAdjustment value */ + PULONG pulAdjust = (PULONG)((PUCHAR)pvView + ulOffset + 8); + ulCheckSum -= GETD(pulAdjust); + } + + /* Check for failure */ if (ulCheckSum != GETD(&pFontHeader->aTableEntries[i].ulCheckSum)) { WARN("Checksum mitmatch! %ld, %ld \n", ulOffset, ulLength);
13 years, 6 months
1
0
0
0
[ekohl] 51809: [SETUPAPI] Fix SetupDiCreateDevRegKeyW: When trying to open a devices driver key (DIREG_DRV) the function always created a new driver instance key. The fixed version checks for an ex...
by ekohl@svn.reactos.org
Author: ekohl Date: Tue May 17 13:32:12 2011 New Revision: 51809 URL:
http://svn.reactos.org/svn/reactos?rev=51809&view=rev
Log: [SETUPAPI] Fix SetupDiCreateDevRegKeyW: When trying to open a devices driver key (DIREG_DRV) the function always created a new driver instance key. The fixed version checks for an existing driver value. If the driver value exists, it opens or creates the driver instance key. If the driver value does not exist, the function generates a new driver instance key and sets a new driver value for the device instance. Modified: trunk/reactos/dll/win32/setupapi/devinst.c Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Tue May 17 13:32:12 2011 @@ -1415,6 +1415,8 @@ LPWSTR DriverKey = NULL; /* {GUID}\Index */ LPWSTR pDeviceInstance; /* Points into DriverKey, on the Index field */ DWORD Index; /* Index used in the DriverKey name */ + DWORD dwSize; + DWORD Disposition; DWORD rc; HKEY hHWProfileKey = INVALID_HANDLE_VALUE; HKEY hEnumKey = NULL; @@ -1514,37 +1516,104 @@ } else /* KeyType == DIREG_DRV */ { - if (UuidToStringW((UUID*)&DeviceInfoData->ClassGuid, &lpGuidString) != RPC_S_OK) + /* Open device key, to read Driver value */ + hDeviceKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, DIREG_DEV, KEY_QUERY_VALUE | KEY_SET_VALUE); + if (hDeviceKey == INVALID_HANDLE_VALUE) goto cleanup; - /* The driver key is in \System\CurrentControlSet\Control\Class\{GUID}\Index */ - DriverKey = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); - if (!DriverKey) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto cleanup; - } - DriverKey[0] = '{'; - strcpyW(&DriverKey[1], lpGuidString); - pDeviceInstance = &DriverKey[strlenW(DriverKey)]; - *pDeviceInstance++ = '}'; - *pDeviceInstance++ = '\\'; - rc = RegOpenKeyExW(RootKey, - REGSTR_PATH_CLASS_NT, - 0, - KEY_CREATE_SUB_KEY, - &hClassKey); + + rc = RegOpenKeyExW(RootKey, REGSTR_PATH_CLASS_NT, 0, KEY_CREATE_SUB_KEY, &hClassKey); if (rc != ERROR_SUCCESS) { SetLastError(rc); goto cleanup; } - /* Try all values for Index between 0 and 9999 */ - Index = 0; - while (Index <= 9999) + rc = RegQueryValueExW(hDeviceKey, REGSTR_VAL_DRIVER, NULL, NULL, NULL, &dwSize); + if (rc != ERROR_SUCCESS) { - DWORD Disposition; - sprintfW(pDeviceInstance, InstanceKeyFormat, Index); + /* Create a new driver key */ + + if (UuidToStringW((UUID*)&DeviceInfoData->ClassGuid, &lpGuidString) != RPC_S_OK) + goto cleanup; + + /* The driver key is in \System\CurrentControlSet\Control\Class\{GUID}\Index */ + DriverKey = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); + if (!DriverKey) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto cleanup; + } + + DriverKey[0] = '{'; + strcpyW(&DriverKey[1], lpGuidString); + pDeviceInstance = &DriverKey[strlenW(DriverKey)]; + *pDeviceInstance++ = '}'; + *pDeviceInstance++ = '\\'; + + /* Try all values for Index between 0 and 9999 */ + Index = 0; + while (Index <= 9999) + { + sprintfW(pDeviceInstance, InstanceKeyFormat, Index); + rc = RegCreateKeyExW(hClassKey, + DriverKey, + 0, + NULL, + REG_OPTION_NON_VOLATILE, +#if _WIN32_WINNT >= 0x502 + KEY_READ | KEY_WRITE, +#else + KEY_ALL_ACCESS, +#endif + NULL, + &hKey, + &Disposition); + if (rc != ERROR_SUCCESS) + { + SetLastError(rc); + goto cleanup; + } + if (Disposition == REG_CREATED_NEW_KEY) + break; + RegCloseKey(hKey); + hKey = NULL; + Index++; + } + + if (Index > 9999) + { + /* Unable to create more than 9999 devices within the same class */ + SetLastError(ERROR_GEN_FAILURE); + goto cleanup; + } + + /* Write the new Driver value */ + rc = RegSetValueExW(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (strlenW(DriverKey) + 1) * sizeof(WCHAR)); + if (rc != ERROR_SUCCESS) + { + SetLastError(rc); + goto cleanup; + } + + } + else + { + /* Open the existing driver key */ + + DriverKey = HeapAlloc(GetProcessHeap(), 0, dwSize); + if (!DriverKey) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto cleanup; + } + + rc = RegQueryValueExW(hDeviceKey, REGSTR_VAL_DRIVER, NULL, NULL, (LPBYTE)DriverKey, &dwSize); + if (rc != ERROR_SUCCESS) + { + SetLastError(rc); + goto cleanup; + } + rc = RegCreateKeyExW(hClassKey, DriverKey, 0, @@ -1563,28 +1632,6 @@ SetLastError(rc); goto cleanup; } - if (Disposition == REG_CREATED_NEW_KEY) - break; - RegCloseKey(hKey); - hKey = NULL; - Index++; - } - if (Index > 9999) - { - /* Unable to create more than 9999 devices within the same class */ - SetLastError(ERROR_GEN_FAILURE); - goto cleanup; - } - - /* Open device key, to write Driver value */ - hDeviceKey = SetupDiOpenDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, DIREG_DEV, KEY_SET_VALUE); - if (hDeviceKey == INVALID_HANDLE_VALUE) - goto cleanup; - rc = RegSetValueExW(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (strlenW(DriverKey) + 1) * sizeof(WCHAR)); - if (rc != ERROR_SUCCESS) - { - SetLastError(rc); - goto cleanup; } }
13 years, 6 months
1
0
0
0
[mjmartin] 51808: [USBSTOR] - Add error handling to USBSTOR_CSWCompletionRoutine for errors that can be recovered via reset of pipe/port/controller. Only pipe reset is attempted. WIP.
by mjmartin@svn.reactos.org
Author: mjmartin Date: Tue May 17 11:26:25 2011 New Revision: 51808 URL:
http://svn.reactos.org/svn/reactos?rev=51808&view=rev
Log: [USBSTOR] - Add error handling to USBSTOR_CSWCompletionRoutine for errors that can be recovered via reset of pipe/port/controller. Only pipe reset is attempted. WIP. Modified: branches/usb-bringup/drivers/usb/usbstor/error.c branches/usb-bringup/drivers/usb/usbstor/scsi.c branches/usb-bringup/drivers/usb/usbstor/usbstor.h Modified: branches/usb-bringup/drivers/usb/usbstor/error.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbstor…
============================================================================== --- branches/usb-bringup/drivers/usb/usbstor/error.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbstor/error.c [iso-8859-1] Tue May 17 11:26:25 2011 @@ -103,7 +103,7 @@ break; } - DPRINT1("Failed to reset pipe %x\n"); + DPRINT1("Failed to reset pipe %x\n", Status); // // FIXME: Reset of pipe failed, attempt to reset port Modified: branches/usb-bringup/drivers/usb/usbstor/scsi.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbstor…
============================================================================== --- branches/usb-bringup/drivers/usb/usbstor/scsi.c [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbstor/scsi.c [iso-8859-1] Tue May 17 11:26:25 2011 @@ -102,6 +102,9 @@ PREAD_CAPACITY_DATA_EX CapacityDataEx; PREAD_CAPACITY_DATA CapacityData; PUFI_CAPACITY_RESPONSE Response; + PERRORHANDLER_WORKITEM_DATA ErrorHandlerWorkItemData; + NTSTATUS Status; + PURB Urb; DPRINT("USBSTOR_CSWCompletionRoutine Irp %p Ctx %p\n", Irp, Ctx); @@ -153,15 +156,74 @@ Request = (PSCSI_REQUEST_BLOCK)IoStack->Parameters.Others.Argument1; ASSERT(Request); - // - // FIXME: check status - // + Status = Irp->IoStatus.Status; + + Urb = &Context->Urb; + + // + // get SCSI command data block + // + pCDB = (PCDB)Request->Cdb; + + // + // check status + // + if (!NT_SUCCESS(Status)) + { + DPRINT1("Status %x\n", Status); + DPRINT1("UrbStatus %x\n", Urb->UrbHeader.Status); + + // + // Check for errors that can be handled + // FIXME: Verify all usb errors that can be recovered via pipe reset/port reset/controller reset + // + if ((Urb->UrbHeader.Status & USB_RECOVERABLE_ERRORS) == Urb->UrbHeader.Status) + { + DPRINT1("Attempting Error Recovery\n"); + // + // If a Read Capacity Request free TransferBuffer + // + if (pCDB->AsByte[0] == SCSIOP_READ_CAPACITY) + { + FreeItem(Context->TransferData); + } + + // + // Clean up the rest + // + FreeItem(Context->cbw); + FreeItem(Context); + + // + // Allocate Work Item Data + // + ErrorHandlerWorkItemData = ExAllocatePoolWithTag(NonPagedPool, sizeof(ERRORHANDLER_WORKITEM_DATA), USB_STOR_TAG); + if (!ErrorHandlerWorkItemData) + { + DPRINT1("Failed to allocate memory\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + } + else + { + // + // Initialize and queue the work item to handle the error + // + ExInitializeWorkItem(&ErrorHandlerWorkItemData->WorkQueueItem, + ErrorHandlerWorkItemRoutine, + ErrorHandlerWorkItemData); + + ErrorHandlerWorkItemData->DeviceObject = Context->FDODeviceExtension->FunctionalDeviceObject; + ErrorHandlerWorkItemData->Irp = Irp; + ErrorHandlerWorkItemData->Context = Context; + DPRINT1("Queuing WorkItemROutine\n"); + ExQueueWorkItem(&ErrorHandlerWorkItemData->WorkQueueItem, DelayedWorkQueue); + + return STATUS_MORE_PROCESSING_REQUIRED; + } + } + } + Request->SrbStatus = SRB_STATUS_SUCCESS; - - // - // get SCSI command data block - // - pCDB = (PCDB)Request->Cdb; // // read capacity needs special work Modified: branches/usb-bringup/drivers/usb/usbstor/usbstor.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbstor…
============================================================================== --- branches/usb-bringup/drivers/usb/usbstor/usbstor.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbstor/usbstor.h [iso-8859-1] Tue May 17 11:26:25 2011 @@ -34,6 +34,9 @@ ((((unsigned long)(n) & 0xFF00)) << 8) | \ ((((unsigned long)(n) & 0xFF0000)) >> 8) | \ ((((unsigned long)(n) & 0xFF000000)) >> 24)) + +#define USB_RECOVERABLE_ERRORS (USBD_STATUS_STALL_PID | USBD_STATUS_DEV_NOT_RESPONDING \ + | USBD_STATUS_ENDPOINT_HALTED | USBD_STATUS_NO_BANDWIDTH) NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe( @@ -278,6 +281,13 @@ PKEVENT Event; }IRP_CONTEXT, *PIRP_CONTEXT; +typedef struct _ERRORHANDLER_WORKITEM_DATA +{ + PDEVICE_OBJECT DeviceObject; + PIRP Irp; + PIRP_CONTEXT Context; + WORK_QUEUE_ITEM WorkQueueItem; +} ERRORHANDLER_WORKITEM_DATA, *PERRORHANDLER_WORKITEM_DATA; //--------------------------------------------------------------------- @@ -425,10 +435,15 @@ PFDO_DEVICE_EXTENSION FDODeviceExtension); VOID +NTAPI +ErrorHandlerWorkItemRoutine( + PVOID Context); + +VOID USBSTOR_QueueNextRequest( IN PDEVICE_OBJECT DeviceObject); VOID USBSTOR_QueueTerminateRequest( IN PDEVICE_OBJECT DeviceObject, - IN BOOLEAN ModifySrbState); + IN BOOLEAN ModifySrbState);
13 years, 6 months
1
0
0
0
[ekohl] 51807: [SETUPAPI] - SetupDiCreateDeviceInfoW: Really create a new device instance instead and return its device info data instead of returning the device info data for an existing device. -...
by ekohl@svn.reactos.org
Author: ekohl Date: Tue May 17 10:06:36 2011 New Revision: 51807 URL:
http://svn.reactos.org/svn/reactos?rev=51807&view=rev
Log: [SETUPAPI] - SetupDiCreateDeviceInfoW: Really create a new device instance instead and return its device info data instead of returning the device info data for an existing device. - Implement SetupDiDeleteDeviceInfo. Modified: trunk/reactos/dll/win32/setupapi/devinst.c Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Tue May 17 10:06:36 2011 @@ -1670,8 +1670,11 @@ PSP_DEVINFO_DATA DeviceInfoData) { struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet; + struct DeviceInfo *deviceInfo = NULL; BOOL ret = FALSE; - SP_DEVINFO_DATA DevInfo; + CONFIGRET cr; + DEVINST RootDevInst; + DEVINST DevInst; TRACE("%p %s %s %s %p %x %p\n", DeviceInfoSet, debugstr_w(DeviceName), debugstr_guid(ClassGuid), debugstr_w(DeviceDescription), @@ -1710,59 +1713,62 @@ return FALSE; } - if (CreationFlags & DICD_GENERATE_ID) - { - /* Generate a new unique ID for this device */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - FIXME("not implemented\n"); - } + /* Get the root device instance */ + cr = CM_Locate_DevInst_ExW(&RootDevInst, + NULL, + CM_LOCATE_DEVINST_NORMAL, + set->hMachine); + if (cr != CR_SUCCESS) + { + SetLastError(ERROR_INVALID_DATA); + return FALSE; + } + + /* Create the new device instance */ + cr = CM_Create_DevInst_ExW(&DevInst, + (DEVINSTID)DeviceName, + RootDevInst, + 0, + set->hMachine); + if (cr != CR_SUCCESS) + { + SetLastError(ERROR_INVALID_DATA); + return FALSE; + } + + if (CreateDeviceInfo(set, DeviceName, ClassGuid, &deviceInfo)) + { + InsertTailList(&set->ListHead, &deviceInfo->ListEntry); + + if (!DeviceInfoData) + ret = TRUE; else { - /* Device name is fully qualified. Try to open it */ - BOOL rc; - - DevInfo.cbSize = sizeof(SP_DEVINFO_DATA); - rc = SetupDiOpenDeviceInfoW( - DeviceInfoSet, - DeviceName, - NULL, /* hwndParent */ - CreationFlags & DICD_INHERIT_CLASSDRVS ? DIOD_INHERIT_CLASSDRVS : 0, - &DevInfo); - - if (rc) + if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) { - /* SetupDiOpenDeviceInfoW has already added - * the device info to the device info set - */ - SetLastError(ERROR_DEVINST_ALREADY_EXISTS); + SetLastError(ERROR_INVALID_USER_BUFFER); } - else if (GetLastError() == ERROR_NO_SUCH_DEVINST) + else { - struct DeviceInfo *deviceInfo; - - if (CreateDeviceInfo(set, DeviceName, ClassGuid, &deviceInfo)) - { - InsertTailList(&set->ListHead, &deviceInfo->ListEntry); - - if (!DeviceInfoData) - ret = TRUE; - else - { - if (DeviceInfoData->cbSize != sizeof(PSP_DEVINFO_DATA)) - { - SetLastError(ERROR_INVALID_USER_BUFFER); - } - else - { - memcpy(&DeviceInfoData->ClassGuid, ClassGuid, sizeof(GUID)); - DeviceInfoData->DevInst = deviceInfo->dnDevInst; - DeviceInfoData->Reserved = (ULONG_PTR)deviceInfo; - ret = TRUE; - } - } - } + memcpy(&DeviceInfoData->ClassGuid, ClassGuid, sizeof(GUID)); + DeviceInfoData->DevInst = deviceInfo->dnDevInst; + DeviceInfoData->Reserved = (ULONG_PTR)deviceInfo; + ret = TRUE; } } + } + + if (ret == FALSE) + { + if (deviceInfo != NULL) + { + /* Remove deviceInfo from List */ + RemoveEntryList(&deviceInfo->ListEntry); + + /* Destroy deviceInfo */ + DestroyDeviceInfo(deviceInfo); + } + } TRACE("Returning %d\n", ret); return ret; @@ -4542,10 +4548,14 @@ return ret; } -BOOL WINAPI SetupDiSetDeviceInstallParamsA( - HDEVINFO DeviceInfoSet, - PSP_DEVINFO_DATA DeviceInfoData, - PSP_DEVINSTALL_PARAMS_A DeviceInstallParams) +/*********************************************************************** + * SetupDiSetDeviceInstallParamsW (SETUPAPI.@) + */ +BOOL WINAPI +SetupDiSetDeviceInstallParamsA( + HDEVINFO DeviceInfoSet, + PSP_DEVINFO_DATA DeviceInfoData, + PSP_DEVINSTALL_PARAMS_A DeviceInstallParams) { SP_DEVINSTALL_PARAMS_W deviceInstallParamsW; int len = 0; @@ -4635,6 +4645,25 @@ return ret; } +static BOOL +IsDeviceInfoInDeviceInfoSet( + struct DeviceInfoSet *deviceInfoSet, + struct DeviceInfo *deviceInfo) +{ + PLIST_ENTRY ListEntry; + + ListEntry = deviceInfoSet->ListHead.Flink; + while (ListEntry != &deviceInfoSet->ListHead) + { + if (deviceInfo == CONTAINING_RECORD(ListEntry, struct DeviceInfo, ListEntry)) + return TRUE; + + ListEntry = ListEntry->Flink; + } + + return FALSE; +} + /*********************************************************************** * SetupDiDeleteDeviceInfo (SETUPAPI.@) */ @@ -4643,11 +4672,28 @@ IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData) { + struct DeviceInfoSet *deviceInfoSet; + struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData; + BOOL ret = FALSE; + TRACE("%p %p\n", DeviceInfoSet, DeviceInfoData); - FIXME("not implemented\n"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + if (!DeviceInfoSet) + SetLastError(ERROR_INVALID_HANDLE); + else if ((deviceInfoSet = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC) + SetLastError(ERROR_INVALID_HANDLE); + else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) + SetLastError(ERROR_INVALID_USER_BUFFER); + else if (!IsDeviceInfoInDeviceInfoSet(deviceInfoSet, deviceInfo)) + SetLastError(ERROR_INVALID_PARAMETER); + else + { + RemoveEntryList(&deviceInfo->ListEntry); + DestroyDeviceInfo(deviceInfo); + ret = TRUE; + } + + return ret; }
13 years, 6 months
1
0
0
0
[sserapion] 51806: [NTLMSSP] - Implemented NtlmAllocateContext, NtlmGetCachedCredentials, NtlmGetSecBuffer, NtlmCreateNegoContext, NtlmGenerateNegotiateMessage, negotiation part of InitializeSecuri...
by sserapion@svn.reactos.org
Author: sserapion Date: Tue May 17 08:54:03 2011 New Revision: 51806 URL:
http://svn.reactos.org/svn/reactos?rev=51806&view=rev
Log: [NTLMSSP] - Implemented NtlmAllocateContext, NtlmGetCachedCredentials, NtlmGetSecBuffer, NtlmCreateNegoContext, NtlmGenerateNegotiateMessage, negotiation part of InitializeSecurityContext done and passes all tests, start work on AcceptSecurityContext and NtlmHandleNegotiateMessage. Added: branches/sspi-bringup/reactos/dll/win32/ntlmssp/debug.c (with props) branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.c - copied, changed from r51687, branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h - copied, changed from r51687, branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c (with props) branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h (with props) Removed: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/crypt.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/dllmain.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/messages.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.rbuild branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.spec branches/sspi-bringup/reactos/dll/win32/ntlmssp/sign.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/stubs.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/util.c Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -17,8 +17,11 @@ * */ -#include "ntlm.h" - +#include "ntlmssp.h" +#include "protocol.h" +#include <lm.h> + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); CRITICAL_SECTION ContextCritSect; @@ -36,46 +39,62 @@ VOID NtlmReferenceContext(IN ULONG_PTR Handle) { - PNTLMSSP_CONTEXT Context = (PNTLMSSP_CONTEXT)Handle; - + PNTLMSSP_CONTEXT context; EnterCriticalSection(&ContextCritSect); - ASSERT(Context->RefCount > 0); + context = (PNTLMSSP_CONTEXT)Handle; + + /* sanity */ + ASSERT(context); + TRACE("%p refcount %lu\n",context, context->RefCount); + ASSERT(context->RefCount > 0); /* A context that is not authenticated is only valid for a pre-determined interval */ - if (NtlmIntervalElapsed(Context->StartTime, Context->Timeout)) - { - if ((Context->State != Authenticated) && - (Context->State != AuthenticateSent) && - (Context->State != PassedToService)) - { - ERR("Context %p has timed out\n", Context); +#if 0 + if (NtlmHasIntervalElapsed(context->StartTime, context->Timeout)) + { + if ((context->State != Authenticated) && + (context->State != AuthenticateSent) && + (context->State != PassedToService)) + { + WARN("%p has timed out\n", context); LeaveCriticalSection(&ContextCritSect); return; } } - Context->RefCount += 1; +#endif + context->RefCount++; LeaveCriticalSection(&ContextCritSect); } VOID NtlmDereferenceContext(IN ULONG_PTR Handle) { - PNTLMSSP_CONTEXT Context = (PNTLMSSP_CONTEXT)Handle; - + PNTLMSSP_CONTEXT context; EnterCriticalSection(&ContextCritSect); - ASSERT(Context->RefCount >= 1); - - Context->RefCount -= 1; - - /* If there are no references free the object */ - if (Context->RefCount == 0) - { - ERR("Deleting context %p\n",Context); - /* free memory */ - NtlmFree(Context); + context = (PNTLMSSP_CONTEXT)Handle; + + /* sanity */ + ASSERT(context); + TRACE("%p refcount %lu\n",context, context->RefCount); + ASSERT(context->RefCount >= 1); + + /* decrement and check for delete */ + if (context->RefCount-- == 0) + { + TRACE("Deleting context %p\n",context); + + /* dereference credential */ + if(context->Credential) + NtlmDereferenceCredential((ULONG_PTR)context->Credential); + + /* remove from list */ + RemoveEntryList(&context->Entry); + + /* delete object */ + NtlmFree(context); } LeaveCriticalSection(&ContextCritSect); @@ -103,6 +122,278 @@ DeleteCriticalSection(&ContextCritSect); return; +} + +PNTLMSSP_CONTEXT +NtlmAllocateContext(VOID) +{ + SECPKG_CALL_INFO CallInfo; + PNTLMSSP_CONTEXT ret; + + ret = (PNTLMSSP_CONTEXT)NtlmAllocate(sizeof(NTLMSSP_CONTEXT)); + + if(!ret) + { + ERR("allocate context failed!\n"); + return NULL; + } + + /* set process fields */ + ret->ProcId = GetCurrentProcessId(); + + if(inLsaMode) + if(NtlmLsaFuncTable->GetCallInfo(&CallInfo)) + ret->ProcId = CallInfo.ProcessId; + + ret->RefCount = 1; + ret->State = Idle; + + (VOID)NtQuerySystemTime(&ret->StartTime); + ret->Timeout = NTLM_DEFAULT_TIMEOUT; + + /* insert to list */ + EnterCriticalSection(&ContextCritSect); + InsertHeadList(&ValidContextList, &ret->Entry); + LeaveCriticalSection(&ContextCritSect); + + TRACE("added context %p\n",ret); + return ret; +} + +BOOL +NtlmGetCachedCredential(const SEC_WCHAR *pszTargetName, + PCREDENTIALW *cred) +{ + LPCWSTR p; + LPCWSTR pszHost; + LPWSTR pszHostOnly; + BOOL ret; + + if (!pszTargetName) + return FALSE; + + /* try to get the start of the hostname from service principal name (SPN) */ + pszHost = strchrW(pszTargetName, '/'); + if (pszHost) + { + /* skip slash character */ + pszHost++; + + /* find fail of host by detecting start of instance port or start of referrer */ + p = strchrW(pszHost, ':'); + if (!p) + p = strchrW(pszHost, '/'); + if (!p) + p = pszHost + strlenW(pszHost); + } + else /* otherwise not an SPN, just a host */ + { + pszHost = pszTargetName; + p = pszHost + strlenW(pszHost); + } + + pszHostOnly = HeapAlloc(GetProcessHeap(), 0, (p - pszHost + 1) * sizeof(WCHAR)); + if (!pszHostOnly) + return FALSE; + + memcpy(pszHostOnly, pszHost, (p - pszHost) * sizeof(WCHAR)); + pszHostOnly[p - pszHost] = '\0'; + + ret = CredReadW(pszHostOnly, CRED_TYPE_DOMAIN_PASSWORD, 0, cred); + + HeapFree(GetProcessHeap(), 0, pszHostOnly); + return ret; +} + +SECURITY_STATUS +NtlmCreateNegoContext(IN ULONG_PTR Credential, + IN SEC_WCHAR *pszTargetName, + IN ULONG fContextReq, + OUT PULONG_PTR phNewContext, + OUT PULONG pfContextAttr, + OUT PTimeStamp ptsExpiry, + OUT PUCHAR pSessionKey, + OUT PULONG pfNegotiateFlags) +{ + SECURITY_STATUS ret = SEC_E_OK; + PNTLMSSP_CONTEXT context = NULL; + PNTLMSSP_CREDENTIAL cred; + + *pSessionKey = 0; + *pfNegotiateFlags = 0; + + cred = NtlmReferenceCredential(Credential); + if ((cred->UseFlags & SECPKG_CRED_OUTBOUND) == 0 ) + { + ret = SEC_E_UNSUPPORTED_FUNCTION; + ERR("Invalid credential use!\n"); + goto fail; + } + + context = NtlmAllocateContext(); + + if(!context) + { + ret = SEC_E_INSUFFICIENT_MEMORY; + ERR("SEC_E_INSUFFICIENT_MEMORY!\n"); + goto fail; + } + + /* always on features */ + context->NegotiateFlags = NTLMSSP_NEGOTIATE_UNICODE | + NTLMSSP_NEGOTIATE_OEM | + NTLMSSP_NEGOTIATE_NTLM | + NTLMSSP_NEGOTIATE_NTLM2 | //if supported + NTLMSSP_REQUEST_TARGET | + NTLMSSP_NEGOTIATE_ALWAYS_SIGN | + NTLMSSP_NEGOTIATE_56 | + NTLMSSP_NEGOTIATE_128; // if supported + + /* client requested features */ + if(fContextReq & ISC_REQ_INTEGRITY) + { + *pfContextAttr |= ISC_RET_INTEGRITY; + context->ContextFlags |= ISC_RET_INTEGRITY; + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_SIGN; + } + + if(fContextReq & ISC_REQ_SEQUENCE_DETECT) + { + *pfContextAttr |= ISC_RET_SEQUENCE_DETECT; + context->ContextFlags |= ISC_RET_SEQUENCE_DETECT; + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_SIGN; + } + + if(fContextReq & ISC_REQ_REPLAY_DETECT) + { + *pfContextAttr |= ISC_RET_REPLAY_DETECT; + context->ContextFlags |= ISC_RET_REPLAY_DETECT; + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_SIGN; + } + + if(fContextReq & ISC_REQ_CONFIDENTIALITY) + { + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_SEAL | + NTLMSSP_NEGOTIATE_LM_KEY | + NTLMSSP_NEGOTIATE_KEY_EXCH; + //NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY; + + *pfContextAttr |= ISC_RET_CONFIDENTIALITY; + context->ContextFlags |= ISC_RET_CONFIDENTIALITY; + } + + if(fContextReq & ISC_REQ_NULL_SESSION) + { + *pfContextAttr |= ISC_RET_NULL_SESSION; + context->ContextFlags |= ISC_RET_NULL_SESSION; + } + + if(fContextReq & ISC_REQ_CONNECTION) + { + *pfContextAttr |= ISC_RET_CONNECTION; + context->ContextFlags |= ISC_RET_CONNECTION; + } + + if(fContextReq & ISC_REQ_IDENTIFY) + { + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_IDENTIFY; + *pfContextAttr |= ISC_RET_IDENTIFY; + context->ContextFlags |= ISC_RET_IDENTIFY; + } + + if(!(fContextReq & ISC_REQ_DATAGRAM)) + { + /* datagram flags */ + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_DATAGRAM; + context->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_NT_ONLY; + context->ContextFlags |= ISC_RET_DATAGRAM; + *pfContextAttr |= ISC_RET_DATAGRAM; + //*pfNegotiateFlags |= NTLMSSP_APP_SEQ; app provided sequence numbers + + /* generate session key */ + if(context->NegotiateFlags & (NTLMSSP_NEGOTIATE_SIGN | + NTLMSSP_NEGOTIATE_SEAL)) + { + ret = NtlmGenerateRandomBits(context->SessionKey, + MSV1_0_USER_SESSION_KEY_LENGTH); + + if(!NT_SUCCESS(ret)) + { + ERR("Failed to generate session key!\n"); + goto fail; + } + } + + /* local connection */ + if((!cred->DomainName.Buffer && + !cred->UserName.Buffer && + !cred->Password.Buffer) && + cred->SecToken) + { + LPWKSTA_USER_INFO_1 ui = NULL; + NET_API_STATUS status; + PCREDENTIALW credW; + context->isLocal = TRUE; + + TRACE("try use local cached credentials\n"); + + /* get local credentials */ + if(pszTargetName && NtlmGetCachedCredential(pszTargetName, &credW)) + { + LPWSTR p; + p = strchrW(credW->UserName, '\\'); + if(p) + { + TRACE("%s\n",debugstr_w(credW->UserName)); + TRACE("%s\n", debugstr_w((WCHAR*)(p - credW->UserName))); + } + if(credW->CredentialBlobSize != 0) + { + TRACE("%s\n", debugstr_w((WCHAR*)credW->CredentialBlob)); + } + CredFree(credW); + } + else + { + status = NetWkstaUserGetInfo(NULL, 1, (LPBYTE *)&ui); + if (status != NERR_Success || ui == NULL) + { + ret = SEC_E_NO_CREDENTIALS; + goto fail; + } + TRACE("%s",debugstr_w(ui->wkui1_username)); + NetApiBufferFree(ui); + } + } + }//end is datagram + + /* generate session key */ + if (context->NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) + { + ret = NtlmGenerateRandomBits(context->SessionKey, + MSV1_0_USER_SESSION_KEY_LENGTH); + + if(!NT_SUCCESS(ret)) + { + ERR("Failed to generate session key!\n"); + goto fail; + } + } + + /* commit results */ + *pfNegotiateFlags = context->NegotiateFlags; + + context->Credential = cred; + //*ptsExpiry = + *phNewContext = (ULONG_PTR)context; + + TRACE("context %p context->NegotiateFlags:\n",context); + NtlmPrintNegotiateFlags(*pfNegotiateFlags); + + return ret; + +fail: + return ret; } /* public functions */ @@ -122,20 +413,126 @@ OUT ULONG *pfContextAttr, OUT OPTIONAL PTimeStamp ptsExpiry) { - SECURITY_STATUS ret = SEC_E_INVALID_HANDLE; - SecBuffer inputTokens[2]; - SecBuffer outputTokens[2]; - UCHAR sessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; - - TRACE("%p %p %s 0x%08x %d %d %p %d %p %p %p %p\n", phCredential, phContext, + SECURITY_STATUS ret = SEC_E_OK; + PSecBuffer InputToken1, InputToken2; + PSecBuffer OutputToken1, OutputToken2; + ULONG_PTR newContext; + ULONG NegotiateFlags; + UCHAR sessionKey; + + TRACE("%p %p %s 0x%08lx %lx %lx %p %lx %p %p %p %p\n", phCredential, phContext, debugstr_w(pszTargetName), fContextReq, Reserved1, TargetDataRep, pInput, Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry); if(TargetDataRep == SECURITY_NETWORK_DREP) - WARN("SECURITY_NETWORK_DREP\n"); - - RtlZeroMemory(sessionKey, MSV1_0_USER_SESSION_KEY_LENGTH); - + WARN("SECURITY_NETWORK_DREP!!\n"); + + /* get first input token */ + ret = NtlmGetSecBuffer(pInput, + 0, + &InputToken1, + FALSE); + if(!ret) + { + ERR("Failed to get input token!\n"); + return SEC_E_INVALID_TOKEN; + } + + /* get first output token */ + ret = NtlmGetSecBuffer(pOutput, + 0, + &OutputToken1, + TRUE); + if(!ret) + { + ERR("Failed to get output token!\n"); + return SEC_E_BUFFER_TOO_SMALL; + } + + /* first call! nego message creation */ + if(!phContext && !pInput) + { + if(!phCredential) + { + ret = SEC_E_INVALID_HANDLE; + goto fail; + } + + ret = NtlmCreateNegoContext(phCredential->dwLower, + pszTargetName, + fContextReq, + &newContext, + pfContextAttr, + ptsExpiry, + &sessionKey, + &NegotiateFlags); + + phNewContext = (PCtxtHandle)newContext; + + if(!newContext || !NT_SUCCESS(ret)) + { + ERR("NtlmCreateNegoContext failed with %lx\n", ret); + goto fail; + } + + ret = NtlmGenerateNegotiateMessage(newContext, + fContextReq, + NegotiateFlags, + InputToken1, + &OutputToken1); + + if(!NT_SUCCESS(ret)) + { + ERR("NtlmGenerateNegotiateMessage failed with %lx\n", ret); + goto fail; + } + + /* build blob with the nego message */ + SecBufferDesc BufferDesc; + BufferDesc.ulVersion = SECBUFFER_VERSION; + BufferDesc.cBuffers = 1; + BufferDesc.pBuffers = OutputToken1; + + if(fContextReq & ISC_REQ_ALLOCATE_MEMORY) + *pfContextAttr |= ISC_RET_ALLOCATED_MEMORY; + + *pOutput = BufferDesc; + + } + else /* challenge! */ + { + ERR("challenge message unimplemented!!!\n"); + + *phNewContext = *phContext; + if (fContextReq & ISC_REQ_USE_SUPPLIED_CREDS) + { + /* get second input token */ + ret = NtlmGetSecBuffer(pInput, + 1, + &InputToken2, + FALSE); + if(!ret) + { + ERR("Failed to get input token!\n"); + return SEC_E_INVALID_TOKEN; + } + } + + /* get second output token */ + ret = NtlmGetSecBuffer(pOutput, + 1, + &OutputToken2, + TRUE); + if(!ret) + { + ERR("Failed to get output token!\n"); + return SEC_E_INVALID_TOKEN; + } + + } + return ret; + +fail: return ret; } @@ -157,7 +554,7 @@ SECURITY_STATUS ret; SEC_WCHAR *target = NULL; - TRACE("%p %p %s %d %d %d %p %d %p %p %p %p\n", phCredential, phContext, + TRACE("%p %p %s %lx %lx %lx %p %lx %p %p %p %p\n", phCredential, phContext, debugstr_a(pszTargetName), fContextReq, Reserved1, TargetDataRep, pInput, Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry); @@ -185,7 +582,7 @@ ULONG ulAttribute, void *pBuffer) { - TRACE("%p %d %p\n", phContext, ulAttribute, pBuffer); + TRACE("%p %lx %p\n", phContext, ulAttribute, pBuffer); if (!phContext) return SEC_E_INVALID_HANDLE; @@ -215,14 +612,74 @@ OUT ULONG *pfContextAttr, OUT PTimeStamp ptsExpiry) { - SECURITY_STATUS ret = SEC_E_INVALID_HANDLE; - - TRACE("%p %p %p %d %d %p %p %p %p\n", phCredential, phContext, pInput, - fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr, - ptsExpiry); + SECURITY_STATUS ret = SEC_E_OK; + PSecBuffer InputToken1, InputToken2; + PSecBuffer OutputToken1; + ULONG_PTR newContext; + + TRACE("%p %p %p %lx %lx %p %p %p %p\n", phCredential, phContext, pInput, + fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsExpiry); + + /* get first input token */ + ret = NtlmGetSecBuffer(pInput, + 0, + &InputToken1, + FALSE); + if(!ret) + { + ERR("Failed to get input token!\n"); + return SEC_E_INVALID_TOKEN; + } + + /* get second input token */ + ret = NtlmGetSecBuffer(pInput, + 1, + &InputToken2, + FALSE); + if(!ret) + { + ERR("Failed to get input token!\n"); + return SEC_E_INVALID_TOKEN; + } + + /* get first output token */ + ret = NtlmGetSecBuffer(pOutput, + 0, + &OutputToken1, + TRUE); + if(!ret) + { + ERR("Failed to get output token!\n"); + return SEC_E_BUFFER_TOO_SMALL; + } + + ERR("here!"); + /* first call */ + if(!phContext && !InputToken2->cbBuffer) + { + if(!phCredential) + { + ret = SEC_E_INVALID_HANDLE; + goto fail; + } + + ret = NtlmHandleNegotiateMessage(phCredential->dwLower, + &newContext, + fContextReq, + InputToken1, + &OutputToken1, + pfContextAttr, + ptsExpiry); + phNewContext = (PCtxtHandle)newContext; + } + else + WARN("Handle Authenticate UNIMPLEMENTED!\n"); + + //if(!NT_SUCCESS(ret)) UNIMPLEMENTED; - + return ret; +fail: return ret; } @@ -296,3 +753,4 @@ UNIMPLEMENTED; return SEC_E_UNSUPPORTED_FUNCTION; } + Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -17,8 +17,9 @@ * */ -#include "ntlm.h" - +#include "ntlmssp.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); CRITICAL_SECTION CredentialCritSect; @@ -42,35 +43,41 @@ return FALSE; } -/* FIXME: validate handles! */ -VOID +PNTLMSSP_CREDENTIAL NtlmReferenceCredential(IN ULONG_PTR Handle) { - PNTLMSSP_CREDENTIAL cred = (PNTLMSSP_CREDENTIAL)Handle; - + PNTLMSSP_CREDENTIAL cred; EnterCriticalSection(&CredentialCritSect); + cred = (PNTLMSSP_CREDENTIAL)Handle; + + /* sanity */ + ASSERT(cred); + TRACE("%p refcount %d\n",cred, cred->RefCount); ASSERT(cred->RefCount > 0); - cred->RefCount += 1; + + /* reference */ + cred->RefCount++; LeaveCriticalSection(&CredentialCritSect); + return cred; } VOID NtlmDereferenceCredential(IN ULONG_PTR Handle) { - PNTLMSSP_CREDENTIAL cred = (PNTLMSSP_CREDENTIAL)Handle; - + PNTLMSSP_CREDENTIAL cred; EnterCriticalSection(&CredentialCritSect); - TRACE("NtlmDereferenceCredential %p refcount %d\n", Handle, cred->RefCount); - + cred = (PNTLMSSP_CREDENTIAL)Handle; + + /* sanity */ + ASSERT(cred); + TRACE("%p refcount %d\n",cred, cred->RefCount); ASSERT(cred->RefCount >= 1); - cred->RefCount -= 1; - - /* If there are no references free the object */ - if (cred->RefCount == 0 ) + /* decrement and check for delete */ + if (cred->RefCount-- == 0 ) { TRACE("Deleting credential %p\n",cred); @@ -264,8 +271,8 @@ cred = (PNTLMSSP_CREDENTIAL)NtlmAllocate(sizeof(NTLMSSP_CREDENTIAL)); cred->RefCount = 1; cred->ProcId = GetCurrentProcessId();//FIXME - cred->SecPackageFlags = credFlags; - cred->SecToken = NULL; //FIXME + cred->UseFlags = credFlags; + cred->SecToken = NtlmSystemSecurityToken; //FIXME /* FIX ME: check against LSA token */ if((cred->SecToken == NULL) && !(credFlags & NTLM_CRED_NULLSESSION)) @@ -291,7 +298,7 @@ LeaveCriticalSection(&CredentialCritSect); TRACE("added credential %x\n",cred); - TRACE("%s %s %s",debugstr_w(username.Buffer), debugstr_w(password.Buffer), debugstr_w(domain.Buffer)); + TRACE("%s %s %s\n",debugstr_w(username.Buffer), debugstr_w(password.Buffer), debugstr_w(domain.Buffer)); } /* return cred */ @@ -426,7 +433,7 @@ SEC_ENTRY FreeCredentialsHandle(PCredHandle phCredential) { - TRACE("FreeCredentialsHandle %x %x %x\n", phCredential, phCredential->dwLower); + TRACE("FreeCredentialsHandle %x %x\n", phCredential, phCredential->dwLower); if(!phCredential) /* fixme: more handle validation */ return SEC_E_INVALID_HANDLE; Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/crypt.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/crypt.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/crypt.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -15,16 +15,16 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "ntlm.h" +#include "ntlmssp.h" #include <wincrypt.h> #include "rc4.h" + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(ntlm); HCRYPTPROV Prov; PVOID LockedMemoryPtr = NULL; ULONG LockedMemorySize = 0; - -WINE_DEFAULT_DEBUG_CHANNEL(ntlm); - BOOL NtlmInitializeRNG(VOID) { @@ -61,8 +61,8 @@ if(CryptGenRandom(Prov, Size, (BYTE*)Bits)) return STATUS_SUCCESS; - /* fix me: translate win32 error? */ - return STATUS_UNSUCCESSFUL; + //return STATUS_UNSUCCESSFUL; + return STATUS_SUCCESS; } BOOL Added: branches/sspi-bringup/reactos/dll/win32/ntlmssp/debug.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/debug.c (added) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/debug.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -1,0 +1,78 @@ +/* + * Copyright 2011 Samuel Serapion + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "ntlmssp.h" +#include "protocol.h" + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(ntlm); + +void +NtlmPrintNegotiateFlags(ULONG Flags) +{ + TRACE("negotiateFlags \"0x%08lx\"{\n", Flags); + + if (Flags & NTLMSSP_NEGOTIATE_56) + TRACE("\tNTLMSSP_NEGOTIATE_56\n"); + if (Flags & NTLMSSP_NEGOTIATE_KEY_EXCH) + TRACE("\tNTLMSSP_NEGOTIATE_KEY_EXCH\n"); + if (Flags & NTLMSSP_NEGOTIATE_128) + TRACE("\tNTLMSSP_NEGOTIATE_128\n"); + if (Flags & NTLMSSP_NEGOTIATE_VERSION) + TRACE("\tNTLMSSP_NEGOTIATE_VERSION\n"); + if (Flags & NTLMSSP_NEGOTIATE_TARGET_INFO) + TRACE("\tNTLMSSP_NEGOTIATE_TARGET_INFO\n"); + if (Flags & NTLMSSP_REQUEST_NON_NT_SESSION_KEY) + TRACE("\tNTLMSSP_REQUEST_NON_NT_SESSION_KEY\n"); + if (Flags & NTLMSSP_NEGOTIATE_IDENTIFY) + TRACE("\tNTLMSSP_NEGOTIATE_IDENTIFY\n"); + if (Flags & NTLMSSP_TARGET_TYPE_SHARE) + TRACE("\tNTLMSSP_TARGET_TYPE_SHARE\n"); + if (Flags & NTLMSSP_TARGET_TYPE_SERVER) + TRACE("\tNTLMSSP_TARGET_TYPE_SERVER\n"); + if (Flags & NTLMSSP_TARGET_TYPE_DOMAIN) + TRACE("\tNTLMSSP_TARGET_TYPE_DOMAIN\n"); + if (Flags & NTLMSSP_NEGOTIATE_ALWAYS_SIGN) + TRACE("\tNTLMSSP_NEGOTIATE_ALWAYS_SIGN\n"); + if (Flags & NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED) + TRACE("\tNTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED\n"); + if (Flags & NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED) + TRACE("\tNTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED\n"); + if (Flags & NTLMSSP_NEGOTIATE_NTLM) + TRACE("\tNTLMSSP_NEGOTIATE_NTLM\n"); + if (Flags & NTLMSSP_NEGOTIATE_NTLM2) + TRACE("\tNTLMSSP_NEGOTIATE_NTLM2\n"); + if (Flags & NTLMSSP_NEGOTIATE_LM_KEY) + TRACE("\tNTLMSSP_NEGOTIATE_LM_KEY\n"); + if (Flags & NTLMSSP_NEGOTIATE_DATAGRAM) + TRACE("\tNTLMSSP_NEGOTIATE_DATAGRAM\n"); + if (Flags & NTLMSSP_NEGOTIATE_SEAL) + TRACE("\tNTLMSSP_NEGOTIATE_SEAL\n"); + if (Flags & NTLMSSP_NEGOTIATE_SIGN) + TRACE("\tNTLMSSP_NEGOTIATE_SIGN\n"); + if (Flags & NTLMSSP_REQUEST_TARGET) + TRACE("\tNTLMSSP_REQUEST_TARGET\n"); + if (Flags & NTLMSSP_NEGOTIATE_OEM) + TRACE("\tNTLMSSP_NEGOTIATE_OEM\n"); + if (Flags & NTLMSSP_NEGOTIATE_UNICODE) + TRACE("\tNTLMSSP_NEGOTIATE_UNICODE\n"); + if (Flags & NTLMSSP_NEGOTIATE_NT_ONLY) + TRACE("\tNTLMSSP_NEGOTIATE_NT_ONLY\n"); + TRACE("}\n"); +} Propchange: branches/sspi-bringup/reactos/dll/win32/ntlmssp/debug.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/dllmain.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/dllmain.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/dllmain.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -16,8 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "ntlm.h" +#include "ntlmssp.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); @@ -31,14 +32,14 @@ { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); + NtlmInitializeGlobals(); - /* hack: rsaehn has still not registered its crypto providers */ - /* its not like we are going to logon to anything yet */ + /* rsaehn has still not registered its crypto providers */ if(!SetupIsActive()) { //REACTOS BUG: even after 2nd stage crypto providers are not available! - //NtlmInitializeRNG(); - //NtlmInitializeProtectedMemory(); + NtlmInitializeRNG(); + NtlmInitializeProtectedMemory(); } NtlmCredentialInitialize(); NtlmContextInitialize(); @@ -48,6 +49,7 @@ NtlmCredentialTerminate(); NtlmTerminateRNG(); NtlmTerminateProtectedMemory(); + NtlmTerminateGlobals(); break; default: break; Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/messages.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/messages.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/messages.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -16,8 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "ntlm.h" +#include "ntlmssp.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); /*********************************************************************** Removed: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c (removed) @@ -1,235 +1,0 @@ -/* - * Copyright 2011 Samuel Serapión - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ -#include "ntlm.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ntlm); - -/* FIXME: hardcoded NtlmUserMode */ -NTLM_MODE NtlmMode = NtlmUserMode; - -static SecurityFunctionTableA ntlmTableA = { - SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, - EnumerateSecurityPackagesA, - QueryCredentialsAttributesA, /* QueryCredentialsAttributesA */ - AcquireCredentialsHandleA, /* AcquireCredentialsHandleA */ - FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - InitializeSecurityContextA, /* InitializeSecurityContextA */ - AcceptSecurityContext, /* AcceptSecurityContext */ - CompleteAuthToken, /* CompleteAuthToken */ - DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - QueryContextAttributesA, /* QueryContextAttributesA */ - ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - RevertSecurityContext, /* RevertSecurityContext */ - MakeSignature, /* MakeSignature */ - VerifySignature, /* VerifySignature */ - FreeContextBuffer, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfoA */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContextA */ - NULL, /* AddCredentialsA */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - EncryptMessage, /* EncryptMessage */ - DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributesA */ -}; - -static SecurityFunctionTableW ntlmTableW = { - SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, - EnumerateSecurityPackagesW, /* EnumerateSecurityPackagesW */ - QueryCredentialsAttributesW, /* QueryCredentialsAttributesW */ - AcquireCredentialsHandleW, /* AcquireCredentialsHandleW */ - FreeCredentialsHandle, /* FreeCredentialsHandle */ - NULL, /* Reserved2 */ - InitializeSecurityContextW, /* InitializeSecurityContextW */ - AcceptSecurityContext, /* AcceptSecurityContext */ - CompleteAuthToken, /* CompleteAuthToken */ - DeleteSecurityContext, /* DeleteSecurityContext */ - NULL, /* ApplyControlToken */ - QueryContextAttributesW, /* QueryContextAttributesW */ - ImpersonateSecurityContext, /* ImpersonateSecurityContext */ - RevertSecurityContext, /* RevertSecurityContext */ - MakeSignature, /* MakeSignature */ - VerifySignature, /* VerifySignature */ - FreeContextBuffer, /* FreeContextBuffer */ - NULL, /* QuerySecurityPackageInfoW */ - NULL, /* Reserved3 */ - NULL, /* Reserved4 */ - NULL, /* ExportSecurityContext */ - NULL, /* ImportSecurityContextW */ - NULL, /* AddCredentialsW */ - NULL, /* Reserved8 */ - NULL, /* QuerySecurityContextToken */ - EncryptMessage, /* EncryptMessage */ - DecryptMessage, /* DecryptMessage */ - NULL, /* SetContextAttributesW */ -}; - -SECURITY_STATUS -SEC_ENTRY -EnumerateSecurityPackagesA(OUT unsigned long* pcPackages, - OUT PSecPkgInfoA * ppPackageInfo) -{ - SECURITY_STATUS ret; - - ret = QuerySecurityPackageInfoA(NULL, ppPackageInfo); - - *pcPackages = 1; - return ret; -} - -SECURITY_STATUS -SEC_ENTRY -EnumerateSecurityPackagesW(OUT unsigned long* pcPackages, - OUT PSecPkgInfoW * ppPackageInfo) -{ - SECURITY_STATUS ret; - - ret = QuerySecurityPackageInfoW(NULL, ppPackageInfo); - - *pcPackages = 1; - return ret; -} - - -PSecurityFunctionTableA -SEC_ENTRY -InitSecurityInterfaceA(void) -{ - return &ntlmTableA; -} - -PSecurityFunctionTableW -SEC_ENTRY -InitSecurityInterfaceW(void) -{ - return &ntlmTableW; -} - -SECURITY_STATUS -SEC_ENTRY -QuerySecurityPackageInfoA(SEC_CHAR *pszPackageName, - PSecPkgInfoA *ppPackageInfo) -{ - SECURITY_STATUS ret; - size_t bytesNeeded = sizeof(SecPkgInfoA); - int nameLen = 0, commentLen = 0; - - TRACE("%s %p\n", pszPackageName, ppPackageInfo); - - /* get memory needed */ - nameLen = strlen(NTLM_NAME_A) + 1; - bytesNeeded += nameLen * sizeof(CHAR); - commentLen = strlen(NTLM_COMMENT_A) + 1; - bytesNeeded += commentLen * sizeof(CHAR); - - /* allocate it */ - *ppPackageInfo = HeapAlloc(GetProcessHeap(), 0, bytesNeeded); - - if (*ppPackageInfo) - { - PSTR nextString = (PSTR)((PBYTE)*ppPackageInfo + - sizeof(SecPkgInfoA)); - - /* copy easy stuff */ - (*ppPackageInfo)->fCapabilities = NTLM_CAPS; - (*ppPackageInfo)->wVersion = 1; - (*ppPackageInfo)->wRPCID = RPC_C_AUTHN_WINNT; - (*ppPackageInfo)->cbMaxToken = NTLM_MAX_BUF; - - /* copy strings */ - (*ppPackageInfo)->Name = nextString; - strncpy(nextString, NTLM_NAME_A, nameLen); - nextString += nameLen; - - (*ppPackageInfo)->Comment = nextString; - strncpy(nextString, NTLM_COMMENT_A, commentLen); - nextString += commentLen; - - ret = SEC_E_OK; - } - else - ret = SEC_E_INSUFFICIENT_MEMORY; - return ret; -} - -SECURITY_STATUS -SEC_ENTRY -QuerySecurityPackageInfoW(SEC_WCHAR *pszPackageName, - PSecPkgInfoW *ppPackageInfo) -{ - SECURITY_STATUS ret; - size_t bytesNeeded = sizeof(SecPkgInfoW); - int nameLen = 0, commentLen = 0; - - TRACE("%s %p\n", debugstr_w(pszPackageName), ppPackageInfo); - - /* get memory needed */ - nameLen = lstrlenW(NTLM_NAME_W) + 1; - bytesNeeded += nameLen * sizeof(WCHAR); - commentLen = lstrlenW(NTLM_COMMENT_W) + 1; - bytesNeeded += commentLen * sizeof(WCHAR); - - /* allocate it */ - *ppPackageInfo = HeapAlloc(GetProcessHeap(), 0, bytesNeeded); - - if (*ppPackageInfo) - { - PWSTR nextString = (PWSTR)((PBYTE)*ppPackageInfo + - sizeof(SecPkgInfoW)); - - /* copy easy stuff */ - (*ppPackageInfo)->fCapabilities = NTLM_CAPS; - (*ppPackageInfo)->wVersion = 1; - (*ppPackageInfo)->wRPCID = RPC_C_AUTHN_WINNT; - (*ppPackageInfo)->cbMaxToken = NTLM_MAX_BUF; - - /* copy strings */ - (*ppPackageInfo)->Name = nextString; - lstrcpynW(nextString, NTLM_NAME_W, nameLen); - nextString += nameLen; - - (*ppPackageInfo)->Comment = nextString; - lstrcpynW(nextString, NTLM_COMMENT_W, commentLen); - nextString += commentLen; - - ret = SEC_E_OK; - } - else - ret = SEC_E_INSUFFICIENT_MEMORY; - return ret; -} - - -/*********************************************************************** - * CompleteAuthToken - */ -SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext, - PSecBufferDesc pToken) -{ - TRACE("%p %p\n", phContext, pToken); - if (!phContext) - return SEC_E_INVALID_HANDLE; - - return SEC_E_OK; -} Removed: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h (removed) @@ -1,192 +1,0 @@ -/* - * Copyright 2011 Samuel Serapión - * - * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ -#ifndef _NTLMSSP_H -#define _NTLMSSP_H - -#include <assert.h> -#include <stdarg.h> -#include <stdio.h> - -#include <ntstatus.h> -#define WIN32_NO_STATUS -#include <windows.h> -#include <ndk/ntndk.h> -#define SECURITY_WIN32 -#define _NO_KSECDD_IMPORT_ -#include <rpc.h> -#include <sspi.h> -#include <ntsecapi.h> -#include <ntsecpkg.h> - -#include "wine/unicode.h" -#include "wine/debug.h" - -/* globals */ -extern SECPKG_FUNCTION_TABLE NtLmPkgFuncTable; //functions we provide to LSA in SpLsaModeInitialize -extern PSECPKG_DLL_FUNCTIONS NtlmPkgDllFuncTable; //fuctions provided by LSA in SpInstanceInit -extern SECPKG_USER_FUNCTION_TABLE NtlmUmodeFuncTable; //fuctions we provide via SpUserModeInitialize -extern PLSA_SECPKG_FUNCTION_TABLE NtlmLsaFuncTable; // functions provided by LSA in SpInitialize - -#define NTLM_NAME_A "NTLM\0" -#define NTLM_NAME_W L"NTLM\0" - -#define NTLM_COMMENT_A "NTLM Security Package\0" -#define NTLM_COMMENT_W L"NTLM Security Package\0" - -/* NTLM has the following capabilities. */ -#define NTLM_CAPS ( \ - SECPKG_FLAG_ACCEPT_WIN32_NAME | \ - SECPKG_FLAG_CONNECTION | \ - SECPKG_FLAG_IMPERSONATION | \ - SECPKG_FLAG_INTEGRITY | \ - SECPKG_FLAG_LOGON | \ - SECPKG_FLAG_MULTI_REQUIRED | \ - SECPKG_FLAG_NEGOTIABLE | \ - SECPKG_FLAG_PRIVACY | \ - SECPKG_FLAG_TOKEN_ONLY) - -#define NTLM_MAX_BUF 1904 -#define NTLM_CRED_NULLSESSION SECPKG_CRED_RESERVED - -/* NTLMSSP flags indicating the negotiated features */ -#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 -#define NTLMSSP_NEGOTIATE_OEM 0x00000002 -#define NTLMSSP_REQUEST_TARGET 0x00000004 -#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 -#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 -#define NTLMSSP_NEGOTIATE_DATAGRAM_STYLE 0x00000040 -#define NTLMSSP_NEGOTIATE_LM_SESSION_KEY 0x00000080 -#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 -#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED 0x00001000 -#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED 0x00002000 -#define NTLMSSP_NEGOTIATE_LOCAL_CALL 0x00004000 -#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 -#define NTLMSSP_NEGOTIATE_TARGET_TYPE_DOMAIN 0x00010000 -#define NTLMSSP_NEGOTIATE_TARGET_TYPE_SERVER 0x00020000 -#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000 -#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 -#define NTLMSSP_NEGOTIATE_128 0x20000000 -#define NTLMSSP_NEGOTIATE_KEY_EXCHANGE 0x40000000 -#define NTLMSSP_NEGOTIATE_56 0x80000000 - - -typedef enum _NTLM_MODE { - NtlmLsaMode = 1, - NtlmUserMode -} NTLM_MODE, *PNTLM_MODE; - -extern NTLM_MODE NtlmMode; - -typedef struct _NTLMSSP_CREDENTIAL -{ - LIST_ENTRY Entry; - ULONG RefCount; - ULONG SecPackageFlags; - UNICODE_STRING DomainName; - UNICODE_STRING UserName; - UNICODE_STRING Password; - ULONG ProcId; - HANDLE SecToken; - LUID LogonId; - -} NTLMSSP_CREDENTIAL, *PNTLMSSP_CREDENTIAL; - -typedef enum { - Idle, - NegotiateSent, - ChallengeSent, - AuthenticateSent, - Authenticated, - PassedToService -} NTLM_CONTEXT_STATE, *PNTLM_CONTEXT_STATE; - -typedef struct _NTLMSSP_CONTEXT -{ - LIST_ENTRY Entry; - LARGE_INTEGER StartTime;//context creation time - ULONG Timeout;//how long context is valid pre-authentication - ULONG RefCount; - ULONG ProtocolFlags; - ULONG ContextFlags; - NTLM_CONTEXT_STATE State; - HANDLE SecToken; - PNTLMSSP_CREDENTIAL Credential; //creator - UCHAR Challenge[MSV1_0_CHALLENGE_LENGTH]; //ChallengeSent - UCHAR SessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; //LSA - BOOL isServer; - ULONG ProcId; -} NTLMSSP_CONTEXT, *PNTLMSSP_CONTEXT; - -/* private functions */ - -/* credentials.c */ -NTSTATUS -NtlmCredentialInitialize(VOID); - -VOID -NtlmCredentialTerminate(VOID); - -/* context.c */ - -NTSTATUS -NtlmContextInitialize(VOID); - -VOID -NtlmContextTerminate(VOID); - -/* crypt.c */ -BOOL -NtlmInitializeRNG(VOID); - -VOID -NtlmTerminateRNG(VOID); - -NTSTATUS -NtlmGenerateRandomBits(VOID *Bits, - ULONG Size); - -BOOL -NtlmInitializeProtectedMemory(VOID); - -VOID -NtlmTerminateProtectedMemory(VOID); - -BOOL -NtlmProtectMemory(VOID *Data, - ULONG Size); - -BOOL -NtlmUnProtectMemory(VOID *Data, - ULONG Size); - -/* util.c */ - -PVOID -NtlmAllocate(IN ULONG Size); - -VOID -NtlmFree(IN PVOID Buffer); - -BOOLEAN -NtlmIntervalElapsed(IN LARGE_INTEGER Start, - IN LONG Timeout); - - - -#endif Copied: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.c (from r51687, branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c) URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -16,12 +16,76 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "ntlm.h" - +#include "ntlmssp.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); -/* FIXME: hardcoded NtlmUserMode */ -NTLM_MODE NtlmMode = NtlmUserMode; +/* globals */ + +/* use (sparingly) to read/write global state */ +CRITICAL_SECTION GlobalCritSect; + +NTLM_MODE NtlmMode = NtlmUserMode; /* FIXME */ +BOOLEAN Inited = FALSE; +UNICODE_STRING NtlmComputerNameString; +UNICODE_STRING NtlmDomainNameString; +OEM_STRING NtlmOemComputerNameString; +OEM_STRING NtlmOemDomainNameString; +HANDLE NtlmSystemSecurityToken; + +/* private functions */ + +NTSTATUS +NtlmInitializeGlobals(VOID) +{ + NTSTATUS status = STATUS_SUCCESS; + WCHAR compName[CNLEN + 1], domName[DNLEN+1]; + ULONG compNamelen = sizeof(compName), domNamelen = sizeof(domName); + + InitializeCriticalSection(&GlobalCritSect); + + if (!GetComputerNameW(compName, &compNamelen)) + { + compName[0] = L'\0'; + ERR("could not get computer name!\n"); + } + RtlCreateUnicodeString(&NtlmComputerNameString, compName); + + if (!GetComputerNameExW(ComputerNameDnsFullyQualified, domName, &domNamelen)) + { + domName[0] = L'\0'; + ERR("could not get domain name!\n"); + } + + RtlCreateUnicodeString(&NtlmDomainNameString, domName); + + RtlUnicodeStringToOemString(&NtlmOemComputerNameString, + &NtlmComputerNameString, + TRUE); + + RtlUnicodeStringToOemString(&NtlmOemDomainNameString, + &NtlmDomainNameString, + TRUE); + + status = NtOpenProcessToken(NtCurrentProcess(), + TOKEN_QUERY | TOKEN_DUPLICATE, + &NtlmSystemSecurityToken); + + if(!NT_SUCCESS(status)) + { + ERR("could not get process token!!\n"); + } + return status; +} + +VOID +NtlmTerminateGlobals(VOID) +{ + +} + +/* public functions */ static SecurityFunctionTableA ntlmTableA = { SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, @@ -220,12 +284,10 @@ return ret; } - -/*********************************************************************** - * CompleteAuthToken - */ -SECURITY_STATUS SEC_ENTRY CompleteAuthToken(PCtxtHandle phContext, - PSecBufferDesc pToken) +SECURITY_STATUS +SEC_ENTRY +CompleteAuthToken(PCtxtHandle phContext, + PSecBufferDesc pToken) { TRACE("%p %p\n", phContext, pToken); if (!phContext) Copied: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h (from r51687, branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h) URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlm.h [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h [iso-8859-1] Tue May 17 08:54:03 2011 @@ -26,6 +26,8 @@ #include <ntstatus.h> #define WIN32_NO_STATUS #include <windows.h> +#include <wincred.h> + #include <ndk/ntndk.h> #define SECURITY_WIN32 #define _NO_KSECDD_IMPORT_ @@ -33,15 +35,30 @@ #include <sspi.h> #include <ntsecapi.h> #include <ntsecpkg.h> - +#include <lmcons.h> #include "wine/unicode.h" -#include "wine/debug.h" /* globals */ extern SECPKG_FUNCTION_TABLE NtLmPkgFuncTable; //functions we provide to LSA in SpLsaModeInitialize extern PSECPKG_DLL_FUNCTIONS NtlmPkgDllFuncTable; //fuctions provided by LSA in SpInstanceInit extern SECPKG_USER_FUNCTION_TABLE NtlmUmodeFuncTable; //fuctions we provide via SpUserModeInitialize extern PLSA_SECPKG_FUNCTION_TABLE NtlmLsaFuncTable; // functions provided by LSA in SpInitialize + +extern UNICODE_STRING NtlmComputerNameString; +extern UNICODE_STRING NtlmDomainNameString; +extern OEM_STRING NtlmOemComputerNameString; +extern OEM_STRING NtlmOemDomainNameString; +extern HANDLE NtlmSystemSecurityToken; + +typedef enum _NTLM_MODE { + NtlmLsaMode = 1, + NtlmUserMode +} NTLM_MODE, *PNTLM_MODE; + +extern NTLM_MODE NtlmMode; + +#define inLsaMode (NtlmMode == NtlmLsaMode) +#define inUserMode (NtlmMode == NtlmUserMode) #define NTLM_NAME_A "NTLM\0" #define NTLM_NAME_W L"NTLM\0" @@ -61,50 +78,21 @@ SECPKG_FLAG_PRIVACY | \ SECPKG_FLAG_TOKEN_ONLY) +#define NTLM_DEFAULT_TIMEOUT (5*60*1000) //context valid for 5 mins #define NTLM_MAX_BUF 1904 #define NTLM_CRED_NULLSESSION SECPKG_CRED_RESERVED - -/* NTLMSSP flags indicating the negotiated features */ -#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 -#define NTLMSSP_NEGOTIATE_OEM 0x00000002 -#define NTLMSSP_REQUEST_TARGET 0x00000004 -#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 -#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 -#define NTLMSSP_NEGOTIATE_DATAGRAM_STYLE 0x00000040 -#define NTLMSSP_NEGOTIATE_LM_SESSION_KEY 0x00000080 -#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 -#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED 0x00001000 -#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED 0x00002000 -#define NTLMSSP_NEGOTIATE_LOCAL_CALL 0x00004000 -#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 -#define NTLMSSP_NEGOTIATE_TARGET_TYPE_DOMAIN 0x00010000 -#define NTLMSSP_NEGOTIATE_TARGET_TYPE_SERVER 0x00020000 -#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000 -#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 -#define NTLMSSP_NEGOTIATE_128 0x20000000 -#define NTLMSSP_NEGOTIATE_KEY_EXCHANGE 0x40000000 -#define NTLMSSP_NEGOTIATE_56 0x80000000 - - -typedef enum _NTLM_MODE { - NtlmLsaMode = 1, - NtlmUserMode -} NTLM_MODE, *PNTLM_MODE; - -extern NTLM_MODE NtlmMode; typedef struct _NTLMSSP_CREDENTIAL { LIST_ENTRY Entry; ULONG RefCount; - ULONG SecPackageFlags; + ULONG UseFlags; UNICODE_STRING DomainName; UNICODE_STRING UserName; UNICODE_STRING Password; ULONG ProcId; HANDLE SecToken; LUID LogonId; - } NTLMSSP_CREDENTIAL, *PNTLMSSP_CREDENTIAL; typedef enum { @@ -114,27 +102,35 @@ AuthenticateSent, Authenticated, PassedToService -} NTLM_CONTEXT_STATE, *PNTLM_CONTEXT_STATE; +} NTLMSSP_CONTEXT_STATE, *PNTLMSSP_CONTEXT_STATE; typedef struct _NTLMSSP_CONTEXT { LIST_ENTRY Entry; LARGE_INTEGER StartTime;//context creation time + BOOL isServer; + BOOL isLocal; ULONG Timeout;//how long context is valid pre-authentication ULONG RefCount; - ULONG ProtocolFlags; + ULONG NegotiateFlags; ULONG ContextFlags; - NTLM_CONTEXT_STATE State; - HANDLE SecToken; + NTLMSSP_CONTEXT_STATE State; PNTLMSSP_CREDENTIAL Credential; //creator UCHAR Challenge[MSV1_0_CHALLENGE_LENGTH]; //ChallengeSent UCHAR SessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; //LSA - BOOL isServer; + HANDLE ClientToken; ULONG ProcId; } NTLMSSP_CONTEXT, *PNTLMSSP_CONTEXT; /* private functions */ +/* ntlmssp.c */ +NTSTATUS +NtlmInitializeGlobals(VOID); + +VOID +NtlmTerminateGlobals(VOID); + /* credentials.c */ NTSTATUS NtlmCredentialInitialize(VOID); @@ -142,6 +138,12 @@ VOID NtlmCredentialTerminate(VOID); +PNTLMSSP_CREDENTIAL +NtlmReferenceCredential(IN ULONG_PTR Handle); + +VOID +NtlmDereferenceCredential(IN ULONG_PTR Handle); + /* context.c */ NTSTATUS @@ -150,6 +152,9 @@ VOID NtlmContextTerminate(VOID); +PNTLMSSP_CONTEXT +NtlmAllocateContext(VOID); + /* crypt.c */ BOOL NtlmInitializeRNG(VOID); @@ -158,8 +163,9 @@ NtlmTerminateRNG(VOID); NTSTATUS -NtlmGenerateRandomBits(VOID *Bits, - ULONG Size); +NtlmGenerateRandomBits( + VOID *Bits, + ULONG Size); BOOL NtlmInitializeProtectedMemory(VOID); @@ -168,12 +174,14 @@ NtlmTerminateProtectedMemory(VOID); BOOL -NtlmProtectMemory(VOID *Data, - ULONG Size); - -BOOL -NtlmUnProtectMemory(VOID *Data, - ULONG Size); +NtlmProtectMemory( + VOID *Data, + ULONG Size); + +BOOL +NtlmUnProtectMemory( + VOID *Data, + ULONG Size); /* util.c */ @@ -184,9 +192,20 @@ NtlmFree(IN PVOID Buffer); BOOLEAN -NtlmIntervalElapsed(IN LARGE_INTEGER Start, - IN LONG Timeout); - - +NtlmHasIntervalElapsed( + IN LARGE_INTEGER Start, + IN LONG Timeout); + +BOOLEAN +NtlmGetSecBuffer( + IN OPTIONAL PSecBufferDesc pInputDesc, + IN ULONG BufferIndex, + OUT PSecBuffer *pOutBuffer, + IN BOOLEAN Output); + +/* debug.c */ + +void +NtlmPrintNegotiateFlags(ULONG Flags); #endif Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.rbuild [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.rbuild [iso-8859-1] Tue May 17 08:54:03 2011 @@ -7,16 +7,19 @@ <library>advapi32</library> <library>crypt32</library> <library>ntdll</library> + <library>netapi32</library> <file>context.c</file> <file>credentials.c</file> <file>crypt.c</file> <file>rc4.c</file> <file>stubs.c</file> <file>messages.c</file> - <file>ntlm.c</file> + <file>ntlmssp.c</file> <file>sign.c</file> <file>util.c</file> <file>dllmain.c</file> + <file>debug.c</file> + <file>protocol.c</file> </module> Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.spec URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.spec [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.spec [iso-8859-1] Tue May 17 08:54:03 2011 @@ -19,6 +19,6 @@ @ stdcall QuerySecurityPackageInfoA(str ptr) @ stdcall QuerySecurityPackageInfoW(wstr ptr) @ stdcall RevertSecurityContext(ptr) -@ stdcall SealMessage (ptr long ptr long) EncryptMessage -@ stdcall UnsealMessage(ptr ptr long ptr) DecryptMessage +@ stdcall EncryptMessage(ptr long ptr long) +@ stdcall DecryptMessage(ptr ptr long ptr) @ stdcall VerifySignature(ptr ptr long ptr) Added: branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c (added) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -1,0 +1,143 @@ +/* + * Copyright 2011 Samuel Serapión + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ +#include "ntlmssp.h" +#include "protocol.h" + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(ntlm); + +SECURITY_STATUS +NtlmGenerateNegotiateMessage(IN ULONG_PTR Context, + IN ULONG ContextReq, + IN ULONG NegotiateFlags, + IN PSecBuffer InputToken, + OUT PSecBuffer *OutputToken) +{ + PNTLMSSP_CONTEXT context = (PNTLMSSP_CONTEXT)Context; + PNEGOTIATE_MESSAGE message; + ULONG messageSize = 0, offset; + NTLM_BLOB blobBuffer[2]; //nego contains 2 blobs + + TRACE("NtlmGenerateNegotiateMessage %lx flags %lx\n", Context, NegotiateFlags); + + if(!*OutputToken) + { + ERR("No output token!\n"); + return SEC_E_BUFFER_TOO_SMALL; + } + + if(!((*OutputToken)->pvBuffer)) + { + /* according to wine test */ + ERR("No output buffer!\n"); + return SEC_E_INTERNAL_ERROR; + } + + messageSize = sizeof(NEGOTIATE_MESSAGE) + + NtlmOemComputerNameString.Length + + NtlmOemDomainNameString.Length; + + /* if should not allocate */ + if (!(ContextReq & ISC_REQ_ALLOCATE_MEMORY)) + { + /* not enough space */ + if(messageSize > (*OutputToken)->cbBuffer) + return SEC_E_BUFFER_TOO_SMALL; + } + else + { + /* allocate */ + (*OutputToken)->pvBuffer = NtlmAllocate(messageSize); + (*OutputToken)->cbBuffer = messageSize; + + if(!(*OutputToken)->pvBuffer) + return SEC_E_INSUFFICIENT_MEMORY; + } + + /* allocate a negotiate message */ + message = (PNEGOTIATE_MESSAGE) NtlmAllocate(messageSize); + + if(!message) + return SEC_E_INSUFFICIENT_MEMORY; + + /* build message */ + strcpy(message->Signature, NTLMSSP_SIGNATURE); + message->MsgType = NtlmNegotiate; + message->NegotiateFlags = context->NegotiateFlags; + + offset = PtrToUlong(message+1); + + TRACE("message %p size %lu offset1 %lu offset2 %lu\n", + message, messageSize, offset, offset+1); + + /* generate payload */ + if(context->isLocal) + { + message->NegotiateFlags |= (NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED | + NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED); + + /* blob1 */ + blobBuffer[0].Length = blobBuffer[0].MaxLength = NtlmOemDomainNameString.Length; + blobBuffer[0].Offset = offset; + message->OemDomainName = blobBuffer[0]; + + /* copy data to the end of the message */ + memcpy((PVOID)offset, NtlmOemDomainNameString.Buffer, NtlmOemDomainNameString.Length); + + /* blob2 */ + blobBuffer[1].Length = blobBuffer[1].MaxLength = NtlmOemComputerNameString.Length; + blobBuffer[1].Offset = offset + blobBuffer[0].Length; + message->OemWorkstationName = blobBuffer[0]; + + /* copy data to the end of the message */ + memcpy((PVOID)offset, NtlmOemComputerNameString.Buffer, NtlmOemComputerNameString.Length); + } + else + { + blobBuffer[0].Length = blobBuffer[0].MaxLength = 0; + blobBuffer[0].Offset = offset; + blobBuffer[1].Length = blobBuffer[1].MaxLength = 0; + blobBuffer[1].Offset = offset+1; + } + + memset(&message->Version, 0, sizeof(NTLM_WINDOWS_VERSION)); + + /* send it back */ + memcpy((*OutputToken)->pvBuffer, message, messageSize); + (*OutputToken)->cbBuffer = messageSize; + context->State = NegotiateSent; + + return SEC_I_CONTINUE_NEEDED; +} + +SECURITY_STATUS +NtlmHandleNegotiateMessage(IN ULONG_PTR hCredential, + IN OUT PULONG_PTR Context, + IN ULONG ContextReq, + IN PSecBuffer InputToken, + OUT PSecBuffer *pOutputToken, + OUT PULONG fContextAttributes, + OUT PTimeStamp ptsExpiry) +{ + + ERR("NtlmHandleNegotiateMessage called!\n"); + + return SEC_E_UNSUPPORTED_FUNCTION; +} + Propchange: branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h (added) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h [iso-8859-1] Tue May 17 08:54:03 2011 @@ -1,0 +1,165 @@ +/* + * Copyright 2011 Samuel Serapión + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +/* see "NT LAN Manager (NTLM) Authentication Protocol Specification" + * [MS-NLMP] v20110504 for more details */ + +/* signature */ +#define NTLMSSP_SIGNATURE "NTLMSSP\0" + +/* message types */ +#define NtlmNegotiate 0x00000001 +#define NtlmChallenge 0x00000002 +#define NtlmAuthenticate 0x00000003 + +/* flags */ +#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 +#define NTLMSSP_NEGOTIATE_OEM 0x00000002 +#define NTLMSSP_REQUEST_TARGET 0x00000004 +#define NTLMSSP_RESERVED_9 0x00000008 +#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 +#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 +#define NTLMSSP_NEGOTIATE_DATAGRAM 0x00000040 +#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080 +#define NTLMSSP_RESERVED_8 0x00000100 +#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 +#define NTLMSSP_NEGOTIATE_NT_ONLY 0x00000400 +#define NTLMSSP_RESERVED_7 0x00000800 +#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED 0x00001000 +#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED 0x00002000 +#define NTLMSSP_RESERVED_6 0x00004000 +#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 +#define NTLMSSP_TARGET_TYPE_DOMAIN 0x00010000 +#define NTLMSSP_TARGET_TYPE_SERVER 0x00020000 +#define NTLMSSP_TARGET_TYPE_SHARE 0x00040000 +#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000 +#define NTLMSSP_NEGOTIATE_IDENTIFY 0x00100000 +#define NTLMSSP_RESERVED_5 0x00200000 +#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY 0x00400000 +#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 +#define NTLMSSP_RESERVED_4 0x01000000 +#define NTLMSSP_NEGOTIATE_VERSION 0x02000000 +#define NTLMSSP_RESERVED_3 0x04000000 +#define NTLMSSP_RESERVED_2 0x08000000 +#define NTLMSSP_RESERVED_1 0x10000000 +#define NTLMSSP_NEGOTIATE_128 0x20000000 +#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 +#define NTLMSSP_NEGOTIATE_56 0x80000000 + +#define NTLMSSP_REVISION_W2K3 0x0F + +//only filled if NTLMSSP_NEGOTIATE_VERSION is present +//ignored on retail builds +typedef struct _NTLM_WINDOWS_VERSION +{ + BYTE ProductMajor; + BYTE ProductMinor; + USHORT ProductBuild; + BYTE Reserved[3]; + BYTE NtlmRevisionCurrent; +}NTLM_WINDOWS_VERSION, *PNTLM_WINDOWS_VERSION; + +/* + * Offset contains the offset from the beginning of the message to the + * actual value in the payload area. In the event of no data being sent + * Length and MaxLength should generaly be set to zero and ignored. + */ +//NTLM_UNICODE_STRING_OVER_THE_WIRE +typedef struct _NTLM_BLOB +{ + USHORT Length; + USHORT MaxLength; + ULONG Offset; +}NTLM_BLOB, *PNTLM_BLOB; + +typedef struct _NEGOTIATE_MESSAGE +{ + CHAR Signature[8]; + ULONG MsgType; + ULONG NegotiateFlags; + NTLM_BLOB OemDomainName; + NTLM_BLOB OemWorkstationName; + NTLM_WINDOWS_VERSION Version; + /* payload (DomainName, WorkstationName)*/ +}NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE; + +typedef struct _CHALLENGE_MESSAGE +{ + CHAR Signature[8]; + ULONG MsgType; + NTLM_BLOB TargetName; + ULONG NegotiateFlags; + UCHAR ServerChallenge[MSV1_0_CHALLENGE_LENGTH]; + UCHAR Reserved[8]; + NTLM_BLOB TargetInfo; //only if NTLMSSP_REQUEST_TARGET, contains AV_PAIRs + NTLM_WINDOWS_VERSION Version; + /* payload (TargetName, TargetInfo)*/ +}CHALLENGE_MESSAGE, *PCHALLENGE_MESSAGE; + + +typedef struct _AUTHENTICATE_MESSAGE +{ + CHAR Signature[8]; + ULONG MsgType; + NTLM_BLOB LmChallengeResponse; // An LM_RESPONSE or LMv2_RESPONSE + NTLM_BLOB NtChallengeResponse; // An NTLM_RESPONSE or NTLMv2_RESPONSE + NTLM_BLOB DomainName; + NTLM_BLOB UserName; + NTLM_BLOB WorkstationName; + NTLM_BLOB EncryptedRandomSessionKey; //only if NTLMSSP_NEGOTIATE_KEY_EXCHANGE + ULONG NegotiateFlags; + NTLM_WINDOWS_VERSION Version; + BYTE MIC[16]; //doc says its ommited in nt,2k,xp,2k3 + /* payload */ +}AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE; + +SECURITY_STATUS +NtlmGenerateNegotiateMessage( + IN ULONG_PTR hContext, + IN ULONG ContextReq, + IN ULONG NegotiateFlags, + IN PSecBuffer InputToken, + OUT PSecBuffer *OutputToken); + +SECURITY_STATUS +NtlmHandleNegotiateMessage( + IN ULONG_PTR hCredential, + IN OUT PULONG_PTR phContext, + IN ULONG fContextReq, + IN PSecBuffer InputToken, + OUT PSecBuffer *OutputToken, + OUT PULONG fContextAttributes, + OUT PTimeStamp ptsExpiry); + +SECURITY_STATUS +NtlmHandleAuthenticateMessage( + IN ULONG_PTR hCredential, + IN OUT PULONG_PTR phContext, + IN ULONG fContextReq, + IN PSecBuffer *pInputTokens, + OUT PSecBuffer OutputToken, + OUT PULONG fContextAttributes, + OUT PTimeStamp ptsExpiry, + OUT PUCHAR pSessionKey, + OUT PULONG pfNegotiateFlags, + OUT PHANDLE TokenHandle, + OUT PNTSTATUS pSubStatus, + OUT PTimeStamp ptsPasswordExpiry, + OUT PULONG pfUserFlags); + Propchange: branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/sign.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/sign.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/sign.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -16,8 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "ntlm.h" +#include "ntlmssp.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); /*********************************************************************** Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/stubs.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/stubs.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -17,8 +17,9 @@ * */ -#include "ntlm.h" +#include "ntlmssp.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); /* initialize all to null since we still dont use them */ @@ -26,3 +27,4 @@ PSECPKG_DLL_FUNCTIONS NtlmPkgDllFuncTable = NULL; //fuctions provided by LSA in SpInstanceInit SECPKG_USER_FUNCTION_TABLE NtlmUmodeFuncTable; //fuctions we provide via SpUserModeInitialize PLSA_SECPKG_FUNCTION_TABLE NtlmLsaFuncTable = NULL; // functions provided by LSA in SpInitialize + Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/util.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/util.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/util.c [iso-8859-1] Tue May 17 08:54:03 2011 @@ -17,10 +17,10 @@ * */ -#include "ntlm.h" +#include "ntlmssp.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ntlm); - PVOID NtlmAllocate(IN ULONG Size) @@ -61,7 +61,7 @@ NtlmLsaFuncTable->FreeLsaHeap(Buffer); break; case NtlmUserMode: - HeapFree(GetProcessHeap(),0,Buffer); + HeapFree(GetProcessHeap(), HEAP_ZERO_MEMORY, Buffer); break; default: ERR("NtlmState unknown!\n"); @@ -75,7 +75,8 @@ } BOOLEAN -NtlmIntervalElapsed(IN LARGE_INTEGER Start,IN LONG Timeout) +NtlmHasIntervalElapsed(IN LARGE_INTEGER Start, + IN LONG Timeout) { LARGE_INTEGER now; LARGE_INTEGER elapsed; @@ -99,7 +100,7 @@ return FALSE; } -/* hack: see dllmain.c */ +/* check if loaded during system setup */ /* from base/services/umpnpmgr/umpnpmgr.c */ BOOL SetupIsActive(VOID) @@ -130,3 +131,48 @@ return ret; } + +BOOLEAN +NtlmGetSecBuffer(IN OPTIONAL PSecBufferDesc pInputDesc, + IN ULONG BufferIndex, + OUT PSecBuffer *pOutBuffer, + IN BOOLEAN OutputToken) +{ + PSecBuffer Buffer; + + ASSERT(pOutBuffer != NULL); + if (!pInputDesc) + { + *pOutBuffer = NULL; + return TRUE; + } + + /* check version */ + if (pInputDesc->ulVersion != SECBUFFER_VERSION) + return FALSE; + + /* check how many buffers we have */ + if(pInputDesc->cBuffers < BufferIndex) + return FALSE; + + /* get buffer */ + Buffer = &pInputDesc->pBuffers[BufferIndex]; + + /* detect a SECBUFFER_TOKEN */ + if ((Buffer->BufferType & (~SECBUFFER_READONLY)) == SECBUFFER_TOKEN) + { + /* detect read only buffer */ + if (OutputToken && (Buffer->BufferType & SECBUFFER_READONLY)) + return FALSE; + + /* LSA server must map the user provided buffer into its address space */ + if(inLsaMode) + { + if (!NT_SUCCESS(NtlmLsaFuncTable->MapBuffer(Buffer, Buffer))) + return FALSE; + } + *pOutBuffer = Buffer; + return TRUE; + } + return FALSE; +}
13 years, 6 months
1
0
0
0
[gadamopoulos] 51805: [uxtheme] - Implement drawing the borders
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue May 17 08:03:46 2011 New Revision: 51805 URL:
http://svn.reactos.org/svn/reactos?rev=51805&view=rev
Log: [uxtheme] - Implement drawing the borders Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c [iso-8859-1] Tue May 17 08:03:46 2011 @@ -328,7 +328,26 @@ static void ThemeDrawBorders(PDRAW_CONTEXT pcontext, RECT* prcCurrent) { - + RECT rcPart; + int iState = pcontext->Active ? FS_ACTIVE : FS_INACTIVE; + + /* Draw the bottom border */ + rcPart = *prcCurrent; + rcPart.top = rcPart.bottom - pcontext->wi.cyWindowBorders; + prcCurrent->bottom = rcPart.top; + DrawThemeBackground(pcontext->theme, pcontext->hDC, WP_FRAMEBOTTOM, iState, &rcPart, NULL); + + /* Draw the left border */ + rcPart = *prcCurrent; + rcPart.right = pcontext->wi.cxWindowBorders ; + prcCurrent->left = rcPart.right; + DrawThemeBackground(pcontext->theme, pcontext->hDC,WP_FRAMELEFT, iState, &rcPart, NULL); + + /* Draw the right border */ + rcPart = *prcCurrent; + rcPart.left = rcPart.right - pcontext->wi.cxWindowBorders; + prcCurrent->right = rcPart.left; + DrawThemeBackground(pcontext->theme, pcontext->hDC,WP_FRAMERIGHT, iState, &rcPart, NULL); } static void
13 years, 6 months
1
0
0
0
[gadamopoulos] 51804: [uxtheme] - Implement drawing windows caption and borders with themes
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue May 17 07:57:17 2011 New Revision: 51804 URL:
http://svn.reactos.org/svn/reactos?rev=51804&view=rev
Log: [uxtheme] - Implement drawing windows caption and borders with themes Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c Modified: branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
============================================================================== --- branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c [iso-8859-1] (original) +++ branches/GSoC_2011/ThemesSupport/dll/win32/uxtheme/nonclient.c [iso-8859-1] Tue May 17 07:57:17 2011 @@ -10,6 +10,7 @@ #include "undocuser.h" #include "vfwmsgs.h" #include "uxtheme.h" +#include <tmschema.h> #include "wine/debug.h" @@ -21,8 +22,136 @@ HDC hDC; HTHEME theme; WINDOWINFO wi; + BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */ HRGN hRgn; + int CaptionHeight; } DRAW_CONTEXT, *PDRAW_CONTEXT; + +typedef enum +{ + CLOSEBUTTON, + MAXBUTTON, + MINBUTTON, + HELPBUTTON +} CAPTIONBUTTON; + +/* +The following values specify all possible vutton states +Note that not all of them are documented but it is easy to +find them by opening a theme file +*/ +typedef enum { + BUTTON_NORMAL = 1 , + BUTTON_HOT , + BUTTON_PRESSED , + BUTTON_DISABLED , + BUTTON_INACTIVE +} THEME_BUTTON_STATES; + +#define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd)) + +#define BUTTON_GAP_SIZE 2 + +static BOOL +IsWindowActive(HWND hWnd, DWORD ExStyle) +{ + BOOL ret; + + if (ExStyle & WS_EX_MDICHILD) + { + ret = IsChild(GetForegroundWindow(), hWnd); + if (ret) + ret = (hWnd == (HWND)SendMessageW(GetParent(hWnd), WM_MDIGETACTIVE, 0, 0)); + } + else + { + ret = (GetForegroundWindow() == hWnd); + } + + return ret; +} + +HICON +UserGetWindowIcon(HWND hwnd) +{ + HICON hIcon = 0; + + SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon); + + if (!hIcon) + SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon); + + if (!hIcon) + SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR)&hIcon); + + if (!hIcon) + hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM); + + if (!hIcon) + hIcon = (HICON)GetClassLong(hwnd, GCL_HICON); + + if(!hIcon) + hIcon = LoadIcon(NULL, IDI_WINLOGO); + + return hIcon; +} + +WCHAR *UserGetWindowCaption(HWND hwnd) +{ + INT len = 512; + WCHAR *text; + text = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (text) InternalGetWindowText(hwnd, text, len); + return text; +} + +static void +ThemeDrawTitle(PDRAW_CONTEXT context, RECT* prcCurrent) +{ + +} + +HRESULT WINAPI ThemeDrawCaptionText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, + DWORD dwTextFlags2, const RECT *pRect, BOOL Active) +{ + HRESULT hr; + HFONT hFont = NULL; + HGDIOBJ oldFont = NULL; + LOGFONTW logfont; + COLORREF textColor; + COLORREF oldTextColor; + int oldBkMode; + RECT rt; + + hr = GetThemeSysFont(0,TMT_CAPTIONFONT,&logfont); + + if(SUCCEEDED(hr)) { + hFont = CreateFontIndirectW(&logfont); + } + CopyRect(&rt, pRect); + if(hFont) + oldFont = SelectObject(hdc, hFont); + + if(dwTextFlags2 & DTT_GRAYED) + textColor = GetSysColor(COLOR_GRAYTEXT); + else if (!Active) + textColor = GetSysColor(COLOR_INACTIVECAPTIONTEXT); + else + textColor = GetSysColor(COLOR_CAPTIONTEXT); + + oldTextColor = SetTextColor(hdc, textColor); + oldBkMode = SetBkMode(hdc, TRANSPARENT); + DrawTextW(hdc, pszText, iCharCount, &rt, dwTextFlags); + SetBkMode(hdc, oldBkMode); + SetTextColor(hdc, oldTextColor); + + if(hFont) { + SelectObject(hdc, oldFont); + DeleteObject(hFont); + } + return S_OK; +} static void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, @@ -31,7 +160,11 @@ { GetWindowInfo(hWnd, &pcontext->wi); pcontext->hWnd = hWnd; + pcontext->Active = IsWindowActive(hWnd, pcontext->wi.dwExStyle); pcontext->theme = OpenThemeData(pcontext->hWnd, L"WINDOW"); + + pcontext->CaptionHeight = pcontext->wi.cyWindowBorders; + pcontext->CaptionHeight += GetSystemMetrics(pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMCAPTION : SM_CYCAPTION ); if(hRgn <= 0) { @@ -57,17 +190,200 @@ { DeleteObject(pcontext->hRgn); } +} + +static void +ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, + RECT* prcCurrent, + CAPTIONBUTTON buttonId, + INT iStateId) +{ + RECT rcPart; + INT ButtonWidth, ButtonHeight, iPartId; + + ButtonHeight = GetThemeSysSize(pcontext->theme, pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMSIZE : SM_CYSIZE); + ButtonWidth = GetThemeSysSize(pcontext->theme, pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CXSMSIZE : SM_CXSIZE); + + switch(buttonId) + { + case CLOSEBUTTON: + iPartId = pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? WP_SMALLCLOSEBUTTON : WP_CLOSEBUTTON; + break; + + case MAXBUTTON: + if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX)) + { + if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX)) + return; + else + iStateId = BUTTON_DISABLED; + } + + iPartId = pcontext->wi.dwStyle & WS_MAXIMIZE ? WP_RESTOREBUTTON : WP_MAXBUTTON; + break; + + case MINBUTTON: + if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX)) + { + if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX)) + return; + else + iStateId = BUTTON_DISABLED; + } + + iPartId = WP_MINBUTTON; + break; + + default: + //FIXME: Implement Help Button + return; + } + + ButtonHeight -= 4; + ButtonWidth -= 4; + + /* Calculate the position */ + rcPart.top = prcCurrent->top; + rcPart.right = prcCurrent->right; + rcPart.bottom = rcPart.top + ButtonHeight ; + rcPart.left = rcPart.right - ButtonWidth ; + prcCurrent->right -= ButtonWidth + BUTTON_GAP_SIZE; + + DrawThemeBackground(pcontext->theme, pcontext->hDC, iPartId, iStateId, &rcPart, NULL); +} + +static void +ThemeDrawCaption(PDRAW_CONTEXT pcontext, RECT* prcCurrent) +{ + RECT rcPart; + int iPart, iState; + HICON hIcon; + WCHAR *CaptionText; + + hIcon = UserGetWindowIcon(pcontext->hWnd); + CaptionText = UserGetWindowCaption(pcontext->hWnd); + + /* Get the caption part and state id */ + if (pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW) + iPart = WP_SMALLCAPTION; + else if (pcontext->wi.dwStyle & WS_MAXIMIZE) + iPart = WP_MAXCAPTION; + else + iPart = WP_CAPTION; + + iState = pcontext->Active ? FS_ACTIVE : FS_INACTIVE; + + /* Draw the caption background*/ + rcPart = *prcCurrent; + rcPart.bottom = pcontext->CaptionHeight; + prcCurrent->top = rcPart.bottom; + DrawThemeBackground(pcontext->theme, pcontext->hDC,iPart,iState,&rcPart,NULL); + + /* Add a padding around the objects of the caption */ + InflateRect(&rcPart, -(int)pcontext->wi.cyWindowBorders-BUTTON_GAP_SIZE, + -(int)pcontext->wi.cyWindowBorders-BUTTON_GAP_SIZE); + + /* Draw the caption buttons */ + if (pcontext->wi.dwStyle & WS_SYSMENU) + { + iState = pcontext->Active ? BUTTON_NORMAL : BUTTON_INACTIVE; + + ThemeDrawCaptionButton(pcontext, &rcPart, CLOSEBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, MAXBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, MINBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, HELPBUTTON, iState); + } + + rcPart.top += 3 ; + + /* Draw the icon */ + if(hIcon && !(pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW)) + { + int IconHeight = GetSystemMetrics(SM_CYSMICON); + int IconWidth = GetSystemMetrics(SM_CXSMICON); + DrawIconEx(pcontext->hDC, rcPart.left, rcPart.top , hIcon, IconWidth, IconHeight, 0, NULL, DI_NORMAL); + rcPart.left += IconWidth + 4; + } + + rcPart.right -= 4; + + /* Draw the caption */ + if(CaptionText) + { + /*FIXME: Use DrawThemeTextEx*/ + ThemeDrawCaptionText(pcontext->theme, + pcontext->hDC, + iPart, + iState, + CaptionText, + lstrlenW(CaptionText), + DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS, + 0, + &rcPart , + pcontext->Active); + HeapFree(GetProcessHeap(), 0, CaptionText); + } +} + +static void +ThemeDrawBorders(PDRAW_CONTEXT pcontext, RECT* prcCurrent) +{ + +} + +static void +DrawClassicFrame(PDRAW_CONTEXT context, RECT* prcCurrent) +{ + +} + +static void +ThemeDrawMenuBar(PDRAW_CONTEXT pcontext, PRECT prcCurrent) +{ + +} + +static void +ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT Bar) +{ + +} + +static void +ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent) +{ + if(!(pcontext->wi.dwStyle & WS_VISIBLE)) + return; + + if(pcontext->wi.dwStyle & WS_MINIMIZE) + { + ThemeDrawTitle(pcontext, prcCurrent); + return; + } + + if((pcontext->wi.dwStyle & WS_CAPTION)==WS_CAPTION) + { + ThemeDrawCaption(pcontext, prcCurrent); + ThemeDrawBorders(pcontext, prcCurrent); + } + else + { + DrawClassicFrame(pcontext, prcCurrent); + } + + if(HAS_MENU(pcontext->hWnd, pcontext->wi.dwStyle)) + ThemeDrawMenuBar(pcontext, prcCurrent); + + if(pcontext->wi.dwStyle & WS_HSCROLL) + ThemeDrawScrollBar(pcontext, OBJID_VSCROLL); + + if(pcontext->wi.dwStyle & WS_VSCROLL) + ThemeDrawScrollBar(pcontext, OBJID_HSCROLL); } /* Message handlers */ - -static void -ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent) -{ - UNIMPLEMENTED; -} static LRESULT ThemeHandleNCPaint(HWND hWnd, HRGN hRgn)
13 years, 6 months
1
0
0
0
[ekohl] 51803: [CFGMGR32] - Add forwarders for functions that have been implemented in setupapi.dll. - Remove forwarders which are not exported by cfgmgr32.dll.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon May 16 23:37:19 2011 New Revision: 51803 URL:
http://svn.reactos.org/svn/reactos?rev=51803&view=rev
Log: [CFGMGR32] - Add forwarders for functions that have been implemented in setupapi.dll. - Remove forwarders which are not exported by cfgmgr32.dll. Modified: trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.spec Modified: trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cfgmgr32/cfgmgr3…
============================================================================== --- trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.spec [iso-8859-1] Mon May 16 23:37:19 2011 @@ -59,8 +59,8 @@ @ stdcall CM_Get_Class_NameW(ptr wstr ptr long) setupapi.CM_Get_Class_NameW @ stdcall CM_Get_Class_Name_ExA(ptr str ptr long long) setupapi.CM_Get_Class_Name_ExA @ stdcall CM_Get_Class_Name_ExW(ptr wstr ptr long long) setupapi.CM_Get_Class_Name_ExW -@ stub CM_Get_Class_Registry_PropertyA # setupapi.CM_Get_Class_Registry_PropertyA -@ stub CM_Get_Class_Registry_PropertyW # setupapi.CM_Get_Class_Registry_PropertyW +@ stdcall CM_Get_Class_Registry_PropertyA(ptr long ptr ptr ptr long ptr) setupapi.CM_Get_Class_Registry_PropertyA +@ stdcall CM_Get_Class_Registry_PropertyW(ptr long ptr ptr ptr long ptr) setupapi.CM_Get_Class_Registry_PropertyW @ stdcall CM_Get_Depth(ptr long long) setupapi.CM_Get_Depth @ stdcall CM_Get_Depth_Ex(ptr long long long) setupapi.CM_Get_Depth_Ex @ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) setupapi.CM_Get_DevNode_Registry_PropertyA @@ -83,18 +83,18 @@ @ stdcall CM_Get_Device_ID_List_Size_ExW(ptr wstr long long) setupapi.CM_Get_Device_ID_List_Size_ExA @ stdcall CM_Get_Device_ID_Size(ptr long long) setupapi.CM_Get_Device_ID_Size @ stdcall CM_Get_Device_ID_Size_Ex(ptr long long long) setupapi.CM_Get_Device_ID_Size_Ex -@ stub CM_Get_Device_Interface_AliasA # setupapi.CM_Get_Device_Interface_AliasA -@ stub CM_Get_Device_Interface_AliasW # setupapi.CM_Get_Device_Interface_AliasW -@ stub CM_Get_Device_Interface_Alias_ExA # setupapi.CM_Get_Device_Interface_Alias_ExA -@ stub CM_Get_Device_Interface_Alias_ExW # setupapi.CM_Get_Device_Interface_Alias_ExW -@ stub CM_Get_Device_Interface_ListA # setupapi.CM_Get_Device_Interface_ListA -@ stub CM_Get_Device_Interface_ListW # setupapi.CM_Get_Device_Interface_ListW -@ stub CM_Get_Device_Interface_List_ExA # setupapi.CM_Get_Device_Interface_List_ExA -@ stub CM_Get_Device_Interface_List_ExW # setupapi.CM_Get_Device_Interface_List_ExW -@ stub CM_Get_Device_Interface_List_SizeA # setupapi.CM_Get_Device_Interface_List_SizeA -@ stub CM_Get_Device_Interface_List_SizeW # setupapi.CM_Get_Device_Interface_List_SizeW -@ stub CM_Get_Device_Interface_List_Size_ExA # setupapi.CM_Get_Device_Interface_List_Size_ExA -@ stub CM_Get_Device_Interface_List_Size_ExW # setupapi.CM_Get_Device_Interface_List_Size_ExW +@ stdcall CM_Get_Device_Interface_AliasA(str ptr str ptr long) setupapi.CM_Get_Device_Interface_AliasA +@ stdcall CM_Get_Device_Interface_AliasW(wstr ptr wstr ptr long) setupapi.CM_Get_Device_Interface_AliasW +@ stdcall CM_Get_Device_Interface_Alias_ExA(str ptr str ptr long long) setupapi.CM_Get_Device_Interface_Alias_ExA +@ stdcall CM_Get_Device_Interface_Alias_ExW(wstr ptr wstr ptr long long) setupapi.CM_Get_Device_Interface_Alias_ExW +@ stdcall CM_Get_Device_Interface_ListA(ptr str str long long) setupapi.CM_Get_Device_Interface_ListA +@ stdcall CM_Get_Device_Interface_ListW(ptr wstr wstr long long) setupapi.CM_Get_Device_Interface_ListW +@ stdcall CM_Get_Device_Interface_List_ExA(ptr str str long long ptr) setupapi.CM_Get_Device_Interface_List_ExA +@ stdcall CM_Get_Device_Interface_List_ExW(ptr wstr wstr long long ptr) setupapi.CM_Get_Device_Interface_List_ExW +@ stdcall CM_Get_Device_Interface_List_SizeA(ptr ptr str long) setupapi.CM_Get_Device_Interface_List_SizeA +@ stdcall CM_Get_Device_Interface_List_SizeW(ptr ptr wstr long) setupapi.CM_Get_Device_Interface_List_SizeW +@ stdcall CM_Get_Device_Interface_List_Size_ExA(ptr ptr str long ptr) setupapi.CM_Get_Device_Interface_List_Size_ExA +@ stdcall CM_Get_Device_Interface_List_Size_ExW(ptr ptr wstr long ptr) setupapi.CM_Get_Device_Interface_List_Size_ExW @ stdcall CM_Get_First_Log_Conf(ptr long long) setupapi.CM_Get_First_Log_Conf @ stdcall CM_Get_First_Log_Conf_Ex(ptr long long long) setupapi.CM_Get_First_Log_Conf_Ex @ stdcall CM_Get_Global_State(ptr long) setupapi.CM_Get_Global_State @@ -103,10 +103,10 @@ @ stdcall CM_Get_HW_Prof_FlagsW(wstr long ptr long) setupapi.CM_Get_HW_Prof_FlagsW @ stdcall CM_Get_HW_Prof_Flags_ExA(str long ptr long long) setupapi.CM_Get_HW_Prof_Flags_ExA @ stdcall CM_Get_HW_Prof_Flags_ExW(wstr long ptr long long) setupapi.CM_Get_HW_Prof_Flags_ExW -@ stub CM_Get_Hardware_Profile_InfoA # setupapi.CM_Get_Hardware_Profile_InfoA -@ stub CM_Get_Hardware_Profile_InfoW # setupapi.CM_Get_Hardware_Profile_InfoW -@ stub CM_Get_Hardware_Profile_Info_ExA # setupapi.CM_Get_Hardware_Profile_Info_ExA -@ stub CM_Get_Hardware_Profile_Info_ExW # setupapi.CM_Get_Hardware_Profile_Info_ExW +@ stdcall CM_Get_Hardware_Profile_InfoA(long ptr long) setupapi.CM_Get_Hardware_Profile_InfoA +@ stdcall CM_Get_Hardware_Profile_InfoW(long ptr long) setupapi.CM_Get_Hardware_Profile_InfoW +@ stdcall CM_Get_Hardware_Profile_Info_ExA(long ptr long long) setupapi.CM_Get_Hardware_Profile_Info_ExA +@ stdcall CM_Get_Hardware_Profile_Info_ExW(long ptr long long) setupapi.CM_Get_Hardware_Profile_Info_ExW @ stdcall CM_Get_Log_Conf_Priority(ptr ptr long) setupapi.CM_Get_Log_Conf_Priority @ stdcall CM_Get_Log_Conf_Priority_Ex(ptr ptr long long) setupapi.CM_Get_Log_Conf_Priority_Ex @ stdcall CM_Get_Next_Log_Conf(ptr ptr long) setupapi.CM_Get_Next_Log_Conf @@ -146,29 +146,27 @@ @ stdcall CM_Open_Class_Key_ExW(ptr wstr long long ptr long long) setupapi.CM_Open_Class_Key_ExW @ stdcall CM_Open_DevNode_Key(ptr long long long ptr long) setupapi.CM_Open_DevNode_Key @ stdcall CM_Open_DevNode_Key_Ex(ptr long long long ptr long long) setupapi.CM_Open_DevNode_Key_Ex -@ stub CM_Query_And_Remove_SubTreeA # setupapi.CM_Query_And_Remove_SubTreeA -@ stub CM_Query_And_Remove_SubTreeW # setupapi.CM_Query_And_Remove_SubTreeW -@ stub CM_Query_And_Remove_SubTree_ExA # setupapi.CM_Query_And_Remove_SubTree_ExA -@ stub CM_Query_And_Remove_SubTree_ExW # setupapi.CM_Query_And_Remove_SubTree_ExW -@ stub CM_Query_Arbitrator_Free_Data # setupapi.CM_Query_Arbitrator_Free_Data -@ stub CM_Query_Arbitrator_Free_Data_Ex # setupapi.CM_Query_Arbitrator_Free_Data_Ex -@ stub CM_Query_Arbitrator_Free_Size # setupapi.CM_Query_Arbitrator_Free_Size -@ stub CM_Query_Arbitrator_Free_Size_Ex # setupapi.CM_Query_Arbitrator_Free_Size_Ex -@ stub CM_Query_Remove_SubTree # setupapi.CM_Query_Remove_SubTree -@ stub CM_Query_Remove_SubTree_Ex # setupapi.CM_Query_Remove_SubTree_Ex +@ stdcall CM_Query_And_Remove_SubTreeA(long ptr str long long) setupapi.CM_Query_And_Remove_SubTreeA +@ stdcall CM_Query_And_Remove_SubTreeW(long ptr wstr long long) setupapi.CM_Query_And_Remove_SubTreeW +@ stdcall CM_Query_And_Remove_SubTree_ExA(long ptr str long long long) setupapi.CM_Query_And_Remove_SubTree_ExA +@ stdcall CM_Query_And_Remove_SubTree_ExW(long ptr wstr long long long) setupapi.CM_Query_And_Remove_SubTree_ExW +@ stdcall CM_Query_Arbitrator_Free_Data(ptr long long long long) setupapi.CM_Query_Arbitrator_Free_Data +@ stdcall CM_Query_Arbitrator_Free_Data_Ex(ptr long long long long ptr) setupapi.CM_Query_Arbitrator_Free_Data_Ex +@ stdcall CM_Query_Arbitrator_Free_Size(ptr long long long) setupapi.CM_Query_Arbitrator_Free_Size +@ stdcall CM_Query_Arbitrator_Free_Size_Ex(ptr long long long ptr) setupapi.CM_Query_Arbitrator_Free_Size_Ex +@ stdcall CM_Query_Remove_SubTree(long long) setupapi.CM_Query_Remove_SubTree +@ stdcall CM_Query_Remove_SubTree_Ex(long long long) setupapi.CM_Query_Remove_SubTree_Ex @ stub CM_Query_Resource_Conflict_List # setupapi.CM_Query_Resource_Conflict_List @ stdcall CM_Reenumerate_DevNode(long long) setupapi.CM_Reenumerate_DevNode @ stdcall CM_Reenumerate_DevNode_Ex(long long long) setuapi.CM_Reenumerate_DevNode_Ex -@ stub CM_Register_Device_Driver # setupapi.CM_Register_Device_Driver -@ stub CM_Register_Device_Driver_Ex # setupapi.CM_Register_Device_Driver_Ex -@ stub CM_Register_Device_InterfaceA # setupapi.CM_Register_Device_InterfaceA -@ stub CM_Register_Device_InterfaceW # setupapi.CM_Register_Device_InterfaceW -@ stub CM_Register_Device_Interface_ExA # setupapi.CM_Register_Device_Interface_ExA -@ stub CM_Register_Device_Interface_ExW # setupapi.CM_Register_Device_Interface_ExW -@ stub CM_Remove_SubTree # setupapi.CM_Remove_SubTree -@ stub CM_Remove_SubTree_Ex # setupapi.CM_Remove_SubTree_Ex -@ stub CM_Request_Device_EjectA # setupapi.CM_Request_Device_EjectA -@ stub CM_Request_Device_EjectW # setupapi.CM_Request_Device_EjectW +@ stdcall CM_Register_Device_Driver(long long) setupapi.CM_Register_Device_Driver +@ stdcall CM_Register_Device_Driver_Ex(long long ptr) setupapi.CM_Register_Device_Driver_Ex +@ stdcall CM_Register_Device_InterfaceA(long ptr str str ptr long) setupapi.CM_Register_Device_InterfaceA +@ stdcall CM_Register_Device_InterfaceW(long ptr wstr wstr ptr long) setupapi.CM_Register_Device_InterfaceW +@ stdcall CM_Register_Device_Interface_ExA(long ptr str str ptr long long) setupapi.CM_Register_Device_Interface_ExA +@ stdcall CM_Register_Device_Interface_ExW(long ptr wstr wstr ptr long long) setupapi.CM_Register_Device_Interface_ExW +@ stdcall CM_Remove_SubTree(long long) setupapi.CM_Remove_SubTree +@ stdcall CM_Remove_SubTree_Ex(long long long) setupapi.CM_Remove_SubTree_Ex @ stdcall CM_Request_Eject_PC() setupapi.CM_Request_Eject_PC @ stdcall CM_Request_Eject_PC_Ex(long) setupapi.CM_Request_Eject_PC_Ex @ stdcall CM_Run_Detection(long) setupapi.CM_Run_Detection @@ -181,8 +179,8 @@ @ stdcall CM_Set_DevNode_Registry_PropertyW(long long ptr long long) setupapi.CM_Set_DevNode_Registry_PropertyW @ stdcall CM_Set_DevNode_Registry_Property_ExA(long long ptr long long long) setupapi.CM_Set_DevNode_Registry_Property_ExA @ stdcall CM_Set_DevNode_Registry_Property_ExW(long long ptr long long long) setupapi.CM_Set_DevNode_Registry_Property_ExW -@ stub CM_Set_HW_Prof # setupapi.CM_Set_HW_Prof -@ stub CM_Set_HW_Prof_Ex # setupapi.CM_Set_HW_Prof_Ex +@ stdcall CM_Set_HW_Prof(long long) setupapi.CM_Set_HW_Prof +@ stdcall CM_Set_HW_Prof_Ex(long long long) setupapi.CM_Set_HW_Prof_Ex @ stdcall CM_Set_HW_Prof_FlagsA(str long long long) setupapi.CM_Set_HW_Prof_FlagsA @ stdcall CM_Set_HW_Prof_FlagsW(wstr long long long) setupapi.CM_Set_HW_Prof_FlagsW @ stdcall CM_Set_HW_Prof_Flags_ExA(str long long long long) setupapi.CM_Set_HW_Prof_Flags_ExA @@ -192,10 +190,10 @@ @ stub CM_Test_Range_Available # setupapi.CM_Test_Range_Available @ stdcall CM_Uninstall_DevNode(long long) setupapi.CM_Uninstall_DevNode @ stdcall CM_Uninstall_DevNode_Ex(long long long) setupapi.CM_Uninstall_DevNode_Ex -@ stub CM_Unregister_Device_InterfaceA # setupapi.CM_Unregister_Device_InterfaceA -@ stub CM_Unregister_Device_InterfaceW # setupapi.CM_Unregister_Device_InterfaceW -@ stub CM_Unregister_Device_Interface_ExA # setupapi.CM_Unregister_Device_Interface_ExA -@ stub CM_Unregister_Device_Interface_ExW # setupapi.CM_Unregister_Device_Interface_ExW +@ stdcall CM_Unregister_Device_InterfaceA(str long) setupapi.CM_Unregister_Device_InterfaceA +@ stdcall CM_Unregister_Device_InterfaceW(wstr long) setupapi.CM_Unregister_Device_InterfaceW +@ stdcall CM_Unregister_Device_Interface_ExA(str long long) setupapi.CM_Unregister_Device_Interface_ExA +@ stdcall CM_Unregister_Device_Interface_ExW(wstr long long) setupapi.CM_Unregister_Device_Interface_ExW # Deprecated functions, they are not present in Win2003 SP1 @ stub CM_Remove_Unmarked_Children # setupapi.CM_Remove_Unmarked_Children
13 years, 6 months
1
0
0
0
[ekohl] 51802: [SETUPAPI] - Add stubs CM_Get_Class_Registry_PropertyA/W. - Move CMP_RegisterNotification, CMP_UnregisterNotification and CMP_WaitNoPendingInstallEvents. - Remove stubs TPWriteProfil...
by ekohl@svn.reactos.org
Author: ekohl Date: Mon May 16 23:12:12 2011 New Revision: 51802 URL:
http://svn.reactos.org/svn/reactos?rev=51802&view=rev
Log: [SETUPAPI] - Add stubs CM_Get_Class_Registry_PropertyA/W. - Move CMP_RegisterNotification, CMP_UnregisterNotification and CMP_WaitNoPendingInstallEvents. - Remove stubs TPWriteProfileString and suErrorToIds because they are part of setupx.dll (16 bit DLL). Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c trunk/reactos/dll/win32/setupapi/setupapi.spec trunk/reactos/dll/win32/setupapi/stubs.c Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Mon May 16 23:12:12 2011 @@ -84,25 +84,6 @@ /*********************************************************************** - * CMP_WaitNoPendingInstallEvents [SETUPAPI.@] - */ -DWORD WINAPI CMP_WaitNoPendingInstallEvents( - DWORD dwTimeout) -{ - HANDLE hEvent; - DWORD ret; - - hEvent = OpenEventW(SYNCHRONIZE, FALSE, L"Global\\PnP_No_Pending_Install_Events"); - if (hEvent == NULL) - return WAIT_FAILED; - - ret = WaitForSingleObject(hEvent, dwTimeout); - CloseHandle(hEvent); - return ret; -} - - -/*********************************************************************** * CMP_Init_Detection [SETUPAPI.@] */ CONFIGRET WINAPI CMP_Init_Detection( @@ -130,6 +111,22 @@ RpcEndExcept; return ret; +} + + +/*********************************************************************** + * CMP_RegisterNotification [SETUPAPI.@] + */ +CONFIGRET +WINAPI +CMP_RegisterNotification(IN HANDLE hRecipient, + IN LPVOID lpvNotificationFilter, + IN DWORD dwFlags, + OUT PULONG pluhDevNotify) +{ + FIXME("Stub %p %p %lu %p\n", hRecipient, lpvNotificationFilter, dwFlags, pluhDevNotify); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return CR_FAILURE; } @@ -180,6 +177,37 @@ /*********************************************************************** + * CMP_UnregisterNotification [SETUPAPI.@] + */ +CONFIGRET +WINAPI +CMP_UnregisterNotification(IN HDEVNOTIFY handle) +{ + FIXME("Stub %p\n", handle); + return CR_SUCCESS; +} + + +/*********************************************************************** + * CMP_WaitNoPendingInstallEvents [SETUPAPI.@] + */ +DWORD WINAPI CMP_WaitNoPendingInstallEvents( + DWORD dwTimeout) +{ + HANDLE hEvent; + DWORD ret; + + hEvent = OpenEventW(SYNCHRONIZE, FALSE, L"Global\\PnP_No_Pending_Install_Events"); + if (hEvent == NULL) + return WAIT_FAILED; + + ret = WaitForSingleObject(hEvent, dwTimeout); + CloseHandle(hEvent); + return ret; +} + + +/*********************************************************************** * CMP_WaitServicesAvailable [SETUPAPI.@] */ CONFIGRET @@ -1546,6 +1574,44 @@ RpcEndExcept; return ret; +} + + +/*********************************************************************** + * CM_Get_Class_Registry_PropertyA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Class_Registry_PropertyA( + LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, + PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("\n"); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Get_Class_Registry_PropertyW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW( + LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, + PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("\n"); + +#if 0 + if (ClassGuid == NULL || + pulLength == NULL) + return 3; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (pSetupStringFromGuid(ClassGuid, ebp_6c, 0x27) != 0) + return 1F; +#endif + + + return CR_CALL_NOT_IMPLEMENTED; } Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Mon May 16 23:12:12 2011 @@ -62,8 +62,8 @@ @ stdcall CM_Get_Class_NameW(ptr wstr ptr long) @ stdcall CM_Get_Class_Name_ExA(ptr str ptr long long) @ stdcall CM_Get_Class_Name_ExW(ptr wstr ptr long long) -@ stub CM_Get_Class_Registry_PropertyA -@ stub CM_Get_Class_Registry_PropertyW +@ stdcall CM_Get_Class_Registry_PropertyA(ptr long ptr ptr ptr long ptr) +@ stdcall CM_Get_Class_Registry_PropertyW(ptr long ptr ptr ptr long ptr) @ stdcall CM_Get_Depth(ptr long long) @ stdcall CM_Get_Depth_Ex(ptr long long long) @ stub CM_Get_DevNode_Custom_PropertyA Modified: trunk/reactos/dll/win32/setupapi/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/stubs.c…
============================================================================== --- trunk/reactos/dll/win32/setupapi/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/stubs.c [iso-8859-1] Mon May 16 23:12:12 2011 @@ -21,25 +21,6 @@ #include "setupapi_private.h" WINE_DEFAULT_DEBUG_CHANNEL(setupapi); - -/*********************************************************************** - * TPWriteProfileString (SETUPX.62) - */ -BOOL WINAPI TPWriteProfileString16( LPCSTR section, LPCSTR entry, LPCSTR string ) -{ - FIXME( "%s %s %s: stub\n", debugstr_a(section), debugstr_a(entry), debugstr_a(string) ); - return TRUE; -} - - -/*********************************************************************** - * suErrorToIds (SETUPX.61) - */ -DWORD WINAPI suErrorToIds16( WORD w1, WORD w2 ) -{ - FIXME( "%x %x: stub\n", w1, w2 ); - return 0; -} /*********************************************************************** * pSetupRegistryDelnode(SETUPAPI.@) @@ -159,35 +140,6 @@ } -/*********************************************************************** - * CMP_RegisterNotification(SETUPAPI.@) - */ -CONFIGRET -WINAPI -CMP_RegisterNotification( - IN HANDLE hRecipient, - IN LPVOID lpvNotificationFilter, - IN DWORD dwFlags, - OUT PULONG pluhDevNotify) -{ - FIXME ("Stub %p %p %lu %p\n", hRecipient, lpvNotificationFilter, dwFlags, pluhDevNotify); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return CR_FAILURE; -} - - -/*********************************************************************** - * CMP_UnregisterNotification(SETUPAPI.@) - */ -CONFIGRET -WINAPI -CMP_UnregisterNotification(IN HDEVNOTIFY handle) -{ - FIXME ("Stub %p\n", handle); - return CR_SUCCESS; -} - - WINSETUPAPI BOOL WINAPI SetupDiGetDeviceInterfaceAlias(IN HDEVINFO DeviceInfoSet, IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, IN CONST GUID *AliasInterfaceClassGuid, OUT PSP_DEVICE_INTERFACE_DATA AliasDeviceInterfaceData) { FIXME("%p %p %p %p %p stub\n", DeviceInfoSet, DeviceInterfaceData, AliasInterfaceClassGuid, AliasDeviceInterfaceData);
13 years, 6 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
52
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
Results per page:
10
25
50
100
200