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
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
36 participants
281 discussions
Start a n
N
ew thread
[reactos] 01/01: [UTILMAN] Add Romanian and Italian translations
by Bișoc George
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3e3a7a63fd1e70ab8b94b…
commit 3e3a7a63fd1e70ab8b94b3bf4f8155b0826c342b Author: Bișoc George <fraizeraust99(a)gmail.com> AuthorDate: Mon Aug 19 20:38:46 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 21:29:56 2019 +0200 [UTILMAN] Add Romanian and Italian translations --- base/applications/utilman/lang/it-IT.rc | 55 +++++++++++++++++++++++++++++++++ base/applications/utilman/lang/ro-RO.rc | 55 +++++++++++++++++++++++++++++++++ base/applications/utilman/utilman.rc | 6 ++++ 3 files changed, 116 insertions(+) diff --git a/base/applications/utilman/lang/it-IT.rc b/base/applications/utilman/lang/it-IT.rc new file mode 100644 index 00000000000..b8ba8000e24 --- /dev/null +++ b/base/applications/utilman/lang/it-IT.rc @@ -0,0 +1,55 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Italian (Italy) translation resource + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL + +IDD_MAIN_DIALOG DIALOGEX 0, 0, 284, 183 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Accessibilità Utility Manager" +FONT 8, "MS Shell Dlg" +BEGIN + LISTBOX IDC_LISTBOX, 4, 4, 273, 56, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER + CONTROL "", IDC_GROUPBOX, "Button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 3, 62, 275, 92 + CONTROL "Avvia", IDC_START, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 76, 45, 16 + CONTROL "Arresta", IDC_STOP, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 69, 76, 45, 16 + CONTROL "Avvia automaticamente all'accesso", IDC_START_LOG_IN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 101, 206, 14 + CONTROL "Avvia automaticamente quando il desktop viene bloccato", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 + CONTROL "Avvia automaticamente quando Utility Manager viene avviato", IDC_START_UTILMAN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 134, 212, 13 + CONTROL "&OK", IDC_OK, "Button", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 161, 50, 14 + CONTROL "&Annulla", IDC_CANCEL, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 221, 161, 50, 14 + CONTROL "?", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 +END + +IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 +CAPTION "Informazioni su Accessibilità Utility Manager" +FONT 8, "MS Shell Dlg", 0, 0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + ICON IDI_ICON_UTILMAN, IDC_STATIC, 10, 10, 7, 30 + LTEXT "Accessibilità Utility Manager\nCopyright (C) 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 48, 7, 150, 36 + LTEXT "Copyright (C) 2019 Hermes Belusca-Maito", IDC_STATIC, 48, 33, 150, 36 + PUSHBUTTON "Chiudi", IDOK, 75, 47, 44, 15 +END + +STRINGTABLE +BEGIN + IDS_OSK "Tastiera su schermo" + IDS_MAGNIFIER "Magnifier" +END + +STRINGTABLE +BEGIN + IDS_NOTRUNNING "%s non è in esecuzione" + IDS_RUNNING "%s è in esecuzione" + IDS_GROUPBOX_OPTIONS_TITLE "Opzioni di %s" +END + +STRINGTABLE +BEGIN + IDM_ABOUT "Informazioni su Accessibilità Utility Manager..." +END diff --git a/base/applications/utilman/lang/ro-RO.rc b/base/applications/utilman/lang/ro-RO.rc new file mode 100644 index 00000000000..20dfac27335 --- /dev/null +++ b/base/applications/utilman/lang/ro-RO.rc @@ -0,0 +1,55 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Romanian (Romania) translation resource + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL + +IDD_MAIN_DIALOG DIALOGEX 0, 0, 284, 183 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Manager utilitare" +FONT 8, "MS Shell Dlg" +BEGIN + LISTBOX IDC_LISTBOX, 4, 4, 273, 56, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER + CONTROL "", IDC_GROUPBOX, "Button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 3, 62, 275, 92 + CONTROL "Start", IDC_START, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 76, 45, 16 + CONTROL "Oprire", IDC_STOP, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 69, 76, 45, 16 + CONTROL "Pornire automată la Log in", IDC_START_LOG_IN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 101, 206, 14 + CONTROL "Pornire automată la blocarea spațiului de lucru", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 + CONTROL "Pornire automată la pornirea Managerului utilități", IDC_START_UTILMAN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 134, 212, 13 + CONTROL "&OK", IDC_OK, "Button", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 161, 50, 14 + CONTROL "&Revocare", IDC_CANCEL, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 221, 161, 50, 14 + CONTROL "&Ajutor", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 +END + +IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 +CAPTION "Despre Managerul utilitare" +FONT 8, "MS Shell Dlg", 0, 0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + ICON IDI_ICON_UTILMAN, IDC_STATIC, 10, 10, 7, 30 + LTEXT "Manager utilitare\nDrept de autor (C) 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 48, 7, 150, 36 + LTEXT "Drept de autor (C) 2019 Hermes Belusca-Maito", IDC_STATIC, 48, 33, 150, 36 + PUSHBUTTON "Închide", IDOK, 75, 47, 44, 15 +END + +STRINGTABLE +BEGIN + IDS_OSK "Tastatură virtuală" + IDS_MAGNIFIER "Lupă" +END + +STRINGTABLE +BEGIN + IDS_NOTRUNNING "%s nu este în curs de execuție" + IDS_RUNNING "%s în curs de execuție" + IDS_GROUPBOX_OPTIONS_TITLE "Opțiuni pentru %s" +END + +STRINGTABLE +BEGIN + IDM_ABOUT "Despre Managerul utilitare..." +END diff --git a/base/applications/utilman/utilman.rc b/base/applications/utilman/utilman.rc index 02fa4614aa7..ab561caeef4 100644 --- a/base/applications/utilman/utilman.rc +++ b/base/applications/utilman/utilman.rc @@ -31,5 +31,11 @@ IDI_ICON_UTILMAN ICON "res/utilman.ico" #ifdef LANGUAGE_FR_FR #include "lang/fr-FR.rc" #endif +#ifdef LANGUAGE_IT_IT + #include "lang/it-IT.rc" +#endif +#ifdef LANGUAGE_RO_RO + #include "lang/ro-RO.rc" +#endif /* EOF */
5 years, 4 months
1
0
0
0
[reactos] 01/01: [COMCTL32] imagelist: Invalidate the cookie of a destroyed imagelist CORE-16316 CORE-16275
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c2b9f94234ccaa6b3bc39…
commit c2b9f94234ccaa6b3bc3921c3560f6c18dfcdb59 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Aug 17 01:42:29 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 21:25:07 2019 +0200 [COMCTL32] imagelist: Invalidate the cookie of a destroyed imagelist CORE-16316 CORE-16275 --- dll/win32/comctl32/imagelist.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dll/win32/comctl32/imagelist.c b/dll/win32/comctl32/imagelist.c index 4b4b0647642..b97adaa90d7 100644 --- a/dll/win32/comctl32/imagelist.c +++ b/dll/win32/comctl32/imagelist.c @@ -115,6 +115,9 @@ struct _IMAGELIST }; #define IMAGELIST_MAGIC 0x53414D58 +#ifdef __REACTOS__ +#define IMAGELIST_MAGIC_DESTROYED 0x44454144 +#endif /* Header used by ImageList_Read() and ImageList_Write() */ #include "pshpack2.h" @@ -3494,6 +3497,9 @@ static ULONG WINAPI ImageListImpl_Release(IImageList2 *iface) if (This->hbrBlend25) DeleteObject (This->hbrBlend25); if (This->hbrBlend50) DeleteObject (This->hbrBlend50); +#ifdef __REACTOS__ + This->usMagic = IMAGELIST_MAGIC_DESTROYED; +#endif This->IImageList2_iface.lpVtbl = NULL; heap_free(This->has_alpha); heap_free(This); @@ -3996,6 +4002,10 @@ static BOOL is_valid(HIMAGELIST himl) { #ifdef __REACTOS__ valid = himl && himl->usMagic == IMAGELIST_MAGIC; + if (!valid && himl && himl->usMagic == IMAGELIST_MAGIC_DESTROYED) + { + ERR("Imagelist no longer valid: 0x%p\n", himl); + } #else valid = himl && himl->IImageList2_iface.lpVtbl == &ImageListImpl_Vtbl; #endif @@ -4098,6 +4108,11 @@ BOOL is_valid2(HIMAGELIST himl) valid = himl && himl->IImageList2_iface.lpVtbl == &ImageListImpl_Vtbl && himl->usMagic == IMAGELIST_MAGIC; + if (!valid && himl && + himl->usMagic == IMAGELIST_MAGIC_DESTROYED) + { + ERR("Imagelist no longer valid: 0x%p\n", himl); + } } __EXCEPT_PAGE_FAULT {
5 years, 4 months
1
0
0
0
[reactos] 01/01: [DNSAPI][DNSAPI_APITEST] Fix DnsQuery_UTF8 function and add tests
by Konstantin Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab2c90f1b9f40751d0b39…
commit ab2c90f1b9f40751d0b399595c4c2dd6250fb8c0 Author: Konstantin Motylkov <mkonst.reut(a)mail.ru> AuthorDate: Mon Aug 19 00:56:27 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 20:01:23 2019 +0200 [DNSAPI][DNSAPI_APITEST] Fix DnsQuery_UTF8 function and add tests CORE-11634 --- dll/win32/dnsapi/dnsapi/query.c | 198 +++++++++++++++++----- modules/rostests/apitests/dnsapi/DnsQuery.c | 249 +++++++++++++++++++++++++++- 2 files changed, 405 insertions(+), 42 deletions(-) diff --git a/dll/win32/dnsapi/dnsapi/query.c b/dll/win32/dnsapi/dnsapi/query.c index a57f0e65a59..7b40b09a867 100644 --- a/dll/win32/dnsapi/dnsapi/query.c +++ b/dll/win32/dnsapi/dnsapi/query.c @@ -77,8 +77,7 @@ DnsCToW(const CHAR *NarrowString) 0); if (WideLen == 0) return NULL; - WideLen *= sizeof(WCHAR); - WideString = RtlAllocateHeap(RtlGetProcessHeap(), 0, WideLen); + WideString = RtlAllocateHeap(RtlGetProcessHeap(), 0, WideLen * sizeof(WCHAR)); if (WideString == NULL) { return NULL; @@ -93,8 +92,67 @@ DnsCToW(const CHAR *NarrowString) return WideString; } +static PCHAR +DnsWToUTF8(const WCHAR *WideString) +{ + PCHAR AnsiString; + int AnsiLen = WideCharToMultiByte(CP_UTF8, + 0, + WideString, + -1, + NULL, + 0, + NULL, + 0); + if (AnsiLen == 0) + return NULL; + AnsiString = RtlAllocateHeap(RtlGetProcessHeap(), 0, AnsiLen); + if (AnsiString == NULL) + { + return NULL; + } + WideCharToMultiByte(CP_UTF8, + 0, + WideString, + -1, + AnsiString, + AnsiLen, + NULL, + 0); + + return AnsiString; +} + +static PWCHAR +DnsUTF8ToW(const CHAR *NarrowString) +{ + PWCHAR WideString; + int WideLen = MultiByteToWideChar(CP_UTF8, + 0, + NarrowString, + -1, + NULL, + 0); + if (WideLen == 0) + return NULL; + WideString = RtlAllocateHeap(RtlGetProcessHeap(), 0, WideLen * sizeof(WCHAR)); + if (WideString == NULL) + { + return NULL; + } + MultiByteToWideChar(CP_UTF8, + 0, + NarrowString, + -1, + WideString, + WideLen); + + return WideString; +} + DNS_STATUS WINAPI -DnsQuery_A(LPCSTR Name, +DnsQuery_CodePage(UINT CodePage, + LPCSTR Name, WORD Type, DWORD Options, PIP4_ARRAY Servers, @@ -112,7 +170,19 @@ DnsQuery_A(LPCSTR Name, if (QueryResultSet == NULL) return ERROR_INVALID_PARAMETER; - Buffer = DnsCToW(Name); + switch (CodePage) + { + case CP_ACP: + Buffer = DnsCToW(Name); + break; + + case CP_UTF8: + Buffer = DnsUTF8ToW(Name); + break; + + default: + return ERROR_INVALID_PARAMETER; + } Status = DnsQuery_W(Buffer, Type, Options, Servers, &QueryResultWide, Reserved); @@ -122,9 +192,46 @@ DnsQuery_A(LPCSTR Name, { case DNS_TYPE_A: case DNS_TYPE_WKS: + case DNS_TYPE_CNAME: + case DNS_TYPE_PTR: + case DNS_TYPE_NS: + case DNS_TYPE_MB: + case DNS_TYPE_MD: + case DNS_TYPE_MF: + case DNS_TYPE_MG: + case DNS_TYPE_MR: ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); + break; + + case DNS_TYPE_MINFO: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_TXT_DATA) + QueryResultWide->Data.TXT.dwStringCount); + break; + + case DNS_TYPE_NULL: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount); + break; + } + if (ConvertedRecord == NULL) + { + /* The name */ + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); + /* The result*/ + DnsIntFreeRecordList(QueryResultWide); + QueryResultSet = NULL; + return ERROR_OUTOFMEMORY; + } + + if (CodePage == CP_ACP) ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName); - ConvertedRecord->wType = QueryResultWide->wType; + else + ConvertedRecord->pName = DnsWToUTF8((PWCHAR)QueryResultWide->pName); + + ConvertedRecord->wType = QueryResultWide->wType; + + switch (QueryResultWide->wType) + { + case DNS_TYPE_A: + case DNS_TYPE_WKS: ConvertedRecord->wDataLength = QueryResultWide->wDataLength; memcpy(&ConvertedRecord->Data, &QueryResultWide->Data, QueryResultWide->wDataLength); break; @@ -137,47 +244,50 @@ DnsQuery_A(LPCSTR Name, case DNS_TYPE_MF: case DNS_TYPE_MG: case DNS_TYPE_MR: - ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); - ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName); - ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_PTR_DATA); - ConvertedRecord->Data.PTR.pNameHost = DnsWToC((PWCHAR)QueryResultWide->Data.PTR.pNameHost); + if (CodePage == CP_ACP) + ConvertedRecord->Data.PTR.pNameHost = DnsWToC((PWCHAR)QueryResultWide->Data.PTR.pNameHost); + else + ConvertedRecord->Data.PTR.pNameHost = DnsWToUTF8((PWCHAR)QueryResultWide->Data.PTR.pNameHost); break; case DNS_TYPE_MINFO: - ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); - ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName); - ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_MINFO_DATA); - ConvertedRecord->Data.MINFO.pNameMailbox = DnsWToC((PWCHAR)QueryResultWide->Data.MINFO.pNameMailbox); - ConvertedRecord->Data.MINFO.pNameErrorsMailbox = DnsWToC((PWCHAR)QueryResultWide->Data.MINFO.pNameErrorsMailbox); + if (CodePage == CP_ACP) + { + ConvertedRecord->Data.MINFO.pNameMailbox = DnsWToC((PWCHAR)QueryResultWide->Data.MINFO.pNameMailbox); + ConvertedRecord->Data.MINFO.pNameErrorsMailbox = DnsWToC((PWCHAR)QueryResultWide->Data.MINFO.pNameErrorsMailbox); + } + else + { + ConvertedRecord->Data.MINFO.pNameMailbox = DnsWToUTF8((PWCHAR)QueryResultWide->Data.MINFO.pNameMailbox); + ConvertedRecord->Data.MINFO.pNameErrorsMailbox = DnsWToUTF8((PWCHAR)QueryResultWide->Data.MINFO.pNameErrorsMailbox); + } break; case DNS_TYPE_MX: - ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); - ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName); - ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_MX_DATA); - ConvertedRecord->Data.MX.pNameExchange = DnsWToC((PWCHAR)QueryResultWide->Data.MX.pNameExchange); + if (CodePage == CP_ACP) + ConvertedRecord->Data.MX.pNameExchange = DnsWToC((PWCHAR)QueryResultWide->Data.MX.pNameExchange); + else + ConvertedRecord->Data.MX.pNameExchange = DnsWToUTF8((PWCHAR)QueryResultWide->Data.MX.pNameExchange); ConvertedRecord->Data.MX.wPreference = QueryResultWide->Data.MX.wPreference; break; case DNS_TYPE_HINFO: - ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_TXT_DATA) + QueryResultWide->Data.TXT.dwStringCount); - ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName); - ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_TXT_DATA) + (sizeof(PCHAR) * QueryResultWide->Data.TXT.dwStringCount); ConvertedRecord->Data.TXT.dwStringCount = QueryResultWide->Data.TXT.dwStringCount; - for (i = 0; i < ConvertedRecord->Data.TXT.dwStringCount; i++) - ConvertedRecord->Data.TXT.pStringArray[i] = DnsWToC((PWCHAR)QueryResultWide->Data.TXT.pStringArray[i]); + if (CodePage == CP_ACP) + for (i = 0; i < ConvertedRecord->Data.TXT.dwStringCount; i++) + ConvertedRecord->Data.TXT.pStringArray[i] = DnsWToC((PWCHAR)QueryResultWide->Data.TXT.pStringArray[i]); + else + for (i = 0; i < ConvertedRecord->Data.TXT.dwStringCount; i++) + ConvertedRecord->Data.TXT.pStringArray[i] = DnsWToUTF8((PWCHAR)QueryResultWide->Data.TXT.pStringArray[i]); break; case DNS_TYPE_NULL: - ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount); - ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName); - ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount; ConvertedRecord->Data.Null.dwByteCount = QueryResultWide->Data.Null.dwByteCount; memcpy(&ConvertedRecord->Data.Null.Data, &QueryResultWide->Data.Null.Data, QueryResultWide->Data.Null.dwByteCount); @@ -208,6 +318,28 @@ DnsQuery_A(LPCSTR Name, return Status; } +DNS_STATUS WINAPI +DnsQuery_A(LPCSTR Name, + WORD Type, + DWORD Options, + PIP4_ARRAY Servers, + PDNS_RECORD *QueryResultSet, + PVOID *Reserved) +{ + return DnsQuery_CodePage(CP_ACP, Name, Type, Options, Servers, QueryResultSet, Reserved); +} + +DNS_STATUS WINAPI +DnsQuery_UTF8(LPCSTR Name, + WORD Type, + DWORD Options, + PIP4_ARRAY Servers, + PDNS_RECORD *QueryResultSet, + PVOID *Reserved) +{ + return DnsQuery_CodePage(CP_UTF8, Name, Type, Options, Servers, QueryResultSet, Reserved); +} + WCHAR *xstrsave(const WCHAR *str) { @@ -687,7 +819,7 @@ DnsQuery_W(LPCWSTR Name, AnsiName[i] == '-' || AnsiName[i] == '_' || AnsiName[i] == '.')) { RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName); - return ERROR_INVALID_NAME; + return DNS_ERROR_INVALID_NAME_CHAR; } i++; } @@ -898,18 +1030,6 @@ DnsQuery_W(LPCWSTR Name, } } -DNS_STATUS WINAPI -DnsQuery_UTF8(LPCSTR Name, - WORD Type, - DWORD Options, - PIP4_ARRAY Servers, - PDNS_RECORD *QueryResultSet, - PVOID *Reserved) -{ - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - void DnsIntFreeRecordList(PDNS_RECORD ToDelete) { diff --git a/modules/rostests/apitests/dnsapi/DnsQuery.c b/modules/rostests/apitests/dnsapi/DnsQuery.c index a659154389f..c4873474a1f 100644 --- a/modules/rostests/apitests/dnsapi/DnsQuery.c +++ b/modules/rostests/apitests/dnsapi/DnsQuery.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS api tests * LICENSE: GPLv2+ - See COPYING in the top level directory - * PURPOSE: Test for DnsQuery_A + * PURPOSE: Test for DnsQuery_A, DnsQuery_UTF8 * PROGRAMMER: Victor Martinez Calvo <victor.martinez(a)reactos.org> */ @@ -19,6 +19,8 @@ void TestHostName(void) DNS_STATUS dns_status; char host_name[255]; char test_name[255]; + char host_nameUTF8[255]; + char test_nameUTF8[255]; PDNS_RECORD dp; WCHAR host_nameW[255]; WCHAR test_nameW[255]; @@ -51,6 +53,7 @@ void TestHostName(void) } HeapFree(GetProcessHeap(), 0, network_info); mbstowcs(host_nameW, host_name, 255); + wcstombs(host_nameUTF8, host_nameW, 255); } //DnsQuery_A: @@ -266,6 +269,246 @@ void TestHostName(void) ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + //DnsQuery_UTF8: + //NULL + dp = InvalidPointer; + dns_status = DnsQuery_UTF8(NULL, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == ERROR_INVALID_PARAMETER, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + ok(dp == InvalidPointer, "dp = %p\n", dp); + + //NULL dp + dns_status = DnsQuery_UTF8(host_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, NULL, 0); + ok(dns_status == ERROR_INVALID_PARAMETER, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + + //Testing HostName + dp = InvalidPointer; + dns_status = DnsQuery_UTF8(host_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + ok(strcmp(dp->pName, host_name) == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, host_name); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + //127.0.0.1 + dp = InvalidPointer; + wcscpy(test_nameW, L"127.0.0.1"); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + ok(strcmp(dp->pName, "127.0.0.1") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "127.0.0.1"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + //Localhost strings + dp = InvalidPointer; + wcscpy(test_nameW, L"LocalHost"); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + /* On Windows 7 is unchanged on XP is lowercased */ + ok(strcmp(dp->pName, "localhost") == 0 || broken(strcmp(dp->pName, "LocalHost") == 0), "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "localhost"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L"Localhost"); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + /* On Windows 7 is unchanged on XP is lowercased */ + ok(strcmp(dp->pName, "localhost") == 0 || broken(strcmp(dp->pName, "Localhost") == 0), "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "localhost"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L"localhost"); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + ok(strcmp(dp->pName, "localhost") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "localhost"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L""); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + /* On Windows 7 is the host on XP is dot ??? */ + ok(strcmp(dp->pName, ".") == 0 || broken(strcmp(dp->pName, host_name) == 0), "DnsQuery_UTF8 returned wrong answer '%s' expected '%s' or '.'\n", dp->pName, host_name); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L" "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + /* On Windows 7 is DNS_ERROR_INVALID_NAME_CHAR on XP is ERROR_TIMEOUT on Win 2k3 is ERROR_INVALID_NAME*/ + ok(dns_status == ERROR_INVALID_NAME || broken(dns_status == ERROR_TIMEOUT) || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 failed with error %lu expected %u or %u or %u\n", dns_status, ERROR_INVALID_NAME, ERROR_TIMEOUT, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, host_name) == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, host_name); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + } + ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L"0.0.0.0"); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == NO_ERROR, "DnsQuery_UTF8 failed with error %lu\n", dns_status); + if (dp != InvalidPointer) + { + ok(strcmp(dp->pName, "0.0.0.0") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "0.0.0.0"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_ANY), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_ANY)); + } + ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); + if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L"0.0.0.0 "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + /* On windows 7 fails with DNS_ERROR_INVALID_NAME_CHAR on XP no error */ + ok(dns_status == NO_ERROR || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u\n", dns_status, NO_ERROR, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "0.0.0.0") == 0 || broken(strcmp(dp->pName, "0.0.0.0 ") == 0), "DnsQuery_UTF8 returned wrong answer '%s' expected '%s' or '%s'\n", dp->pName, "0.0.0.0", "0.0.0.0 "); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_ANY), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_ANY)); + } + ok(dp != InvalidPointer || broken(dp == InvalidPointer) || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L"127.0.0.1 "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + /* On windows 7 fails with DNS_ERROR_INVALID_NAME_CHAR on XP no error */ + ok(dns_status == NO_ERROR || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u\n", dns_status, NO_ERROR, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "127.0.0.1") == 0 || strcmp(dp->pName, "127.0.0.1 ") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s' or '%s'\n", dp->pName, "127.0.0.1", "127.0.0.1 "); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp != InvalidPointer || broken(dp == InvalidPointer) || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L" 127.0.0.1 "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == DNS_ERROR_RCODE_NAME_ERROR || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u\n", dns_status, DNS_ERROR_RCODE_NAME_ERROR, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "127.0.0.1") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "127.0.0.1"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L" 127.0. 0.1 "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == DNS_ERROR_RCODE_NAME_ERROR || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u\n", dns_status, DNS_ERROR_RCODE_NAME_ERROR, DNS_ERROR_INVALID_NAME_CHAR); + if (dp == InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "127.0.0.1") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "127.0.0.1"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L"localhost "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == ERROR_INVALID_NAME || broken(dns_status == ERROR_TIMEOUT) || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u or %u\n", dns_status, ERROR_INVALID_NAME, ERROR_TIMEOUT, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "localhost") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "localhost"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L" localhost"); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == ERROR_INVALID_NAME || broken(dns_status == ERROR_TIMEOUT) || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u or %u\n", dns_status, ERROR_INVALID_NAME, ERROR_TIMEOUT, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "localhost") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "localhost"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + + dp = InvalidPointer; + wcscpy(test_nameW, L" local host "); + wcstombs(test_nameUTF8, test_nameW, 255); + dns_status = DnsQuery_UTF8(test_nameUTF8, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); + ok(dns_status == ERROR_INVALID_NAME || broken(dns_status == ERROR_TIMEOUT) || broken(dns_status == DNS_ERROR_INVALID_NAME_CHAR), "DnsQuery_UTF8 wrong status %lu expected %u or %u or %u\n", dns_status, ERROR_INVALID_NAME, ERROR_TIMEOUT, DNS_ERROR_INVALID_NAME_CHAR); + if (dp != InvalidPointer && dns_status == NO_ERROR) + { + ok(strcmp(dp->pName, "localhost") == 0, "DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->pName, "localhost"); + ok(dp->wType == DNS_TYPE_A, "DnsQuery_UTF8 returned wrong type %d expected %d\n", dp->wType, DNS_TYPE_A); + ok(dp->wDataLength == sizeof(IP4_ADDRESS), "DnsQuery_UTF8 returned wrong data size %d\n", dp->wDataLength); + ok(dp->Data.A.IpAddress == ntohl(INADDR_LOOPBACK), "DnsQuery_UTF8 returned wrong data %ld expected %ld\n", dp->Data.A.IpAddress, ntohl(INADDR_LOOPBACK)); + } + ok(dp == InvalidPointer || broken(dp == NULL), "dp = %p\n", dp); + if (dp != InvalidPointer && dns_status == NO_ERROR) DnsRecordListFree(dp, DnsFreeRecordList); + //DnsQuery_W: //NULL dp = InvalidPointer; @@ -288,7 +531,7 @@ void TestHostName(void) dns_status = DnsQuery_W(host_nameW, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, NULL, 0); ok(dns_status == ERROR_INVALID_PARAMETER, "DnsQuery_W failed with error %lu\n", dns_status); - //Testing HostName + //Testing HostName dns_status = DnsQuery_W(host_nameW, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); ok(dns_status == NO_ERROR, "DnsQuery_W failed with error %lu\n", dns_status); if (dp != InvalidPointer) @@ -299,7 +542,7 @@ void TestHostName(void) } ok(dp != InvalidPointer && dp != NULL, "dp = %p\n", dp); if (dp != InvalidPointer) DnsRecordListFree(dp, DnsFreeRecordList); - + //127.0.0.1 dns_status = DnsQuery_W(L"127.0.0.1", DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0); ok(dns_status == NO_ERROR, "DnsQuery_W failed with error %lu\n", dns_status);
5 years, 4 months
1
0
0
0
[reactos] 01/01: [UTILMAN] Meh
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=db4b34a046ee0dd23e497…
commit db4b34a046ee0dd23e497fd0a47ec5ce771e870b Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Mon Aug 19 19:46:08 2019 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Mon Aug 19 19:46:08 2019 +0200 [UTILMAN] Meh --- base/applications/utilman/lang/fr-FR.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/utilman/lang/fr-FR.rc b/base/applications/utilman/lang/fr-FR.rc index 6f17a5c83ee..f5c79a3f98d 100644 --- a/base/applications/utilman/lang/fr-FR.rc +++ b/base/applications/utilman/lang/fr-FR.rc @@ -18,7 +18,7 @@ BEGIN CONTROL "Démarrer", IDC_START, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 76, 45, 16 CONTROL "Arrêter", IDC_STOP, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 69, 76, 45, 16 CONTROL "Démarrer automatiquement quand je me connecte", IDC_START_LOG_IN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 101, 206, 14 - CONTROL "Démarrer automatiquement quand je suis sur le bureau", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 + CONTROL "Démarrer automatiquement quand je verrouille mon bureau", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 CONTROL "Démarrer automatiquement quand le gestionnaire démarre", IDC_START_UTILMAN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 134, 212, 13 CONTROL "&OK", IDC_OK, "Button", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 161, 50, 14 CONTROL "&Annuler", IDC_CANCEL, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 221, 161, 50, 14
5 years, 4 months
1
0
0
0
[reactos] 01/01: [UTILMAN] Fix Small typo in one of the checkboxes
by Shy Zedaka
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ff7938095ed994e25fd97…
commit ff7938095ed994e25fd974b95abb3ac3db23eef9 Author: Shy Zedaka <shaytzedaka(a)outlook.com> AuthorDate: Mon Aug 19 20:13:55 2019 +0300 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 19:42:01 2019 +0200 [UTILMAN] Fix Small typo in one of the checkboxes --- base/applications/utilman/lang/en-US.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/utilman/lang/en-US.rc b/base/applications/utilman/lang/en-US.rc index eff32a39511..01f77285d09 100644 --- a/base/applications/utilman/lang/en-US.rc +++ b/base/applications/utilman/lang/en-US.rc @@ -18,7 +18,7 @@ BEGIN CONTROL "Start", IDC_START, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 76, 45, 16 CONTROL "Stop", IDC_STOP, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 69, 76, 45, 16 CONTROL "Start automatically when I log in", IDC_START_LOG_IN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 101, 206, 14 - CONTROL "Start automatically when I look my desktop", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 + CONTROL "Start automatically when I lock my desktop", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 CONTROL "Start automatically when Utility Manager starts", IDC_START_UTILMAN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 134, 212, 13 CONTROL "&OK", IDC_OK, "Button", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 161, 50, 14 CONTROL "&Cancel", IDC_CANCEL, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 221, 161, 50, 14
5 years, 4 months
1
0
0
0
[reactos] 01/01: [UTILMAN] Fix the build for msvc
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=012413813d7fac815b0ee…
commit 012413813d7fac815b0eeb353d7cc81ba12718d2 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Mon Aug 19 14:13:43 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 14:13:43 2019 +0200 [UTILMAN] Fix the build for msvc --- base/applications/utilman/lang/en-US.rc | 3 ++- base/applications/utilman/lang/fr-FR.rc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/applications/utilman/lang/en-US.rc b/base/applications/utilman/lang/en-US.rc index 582c69b57c3..eff32a39511 100644 --- a/base/applications/utilman/lang/en-US.rc +++ b/base/applications/utilman/lang/en-US.rc @@ -5,11 +5,12 @@ * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) */ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + IDD_MAIN_DIALOG DIALOGEX 0, 0, 284, 183 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Accessibility Utility Manager" -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US FONT 8, "MS Shell Dlg" BEGIN LISTBOX IDC_LISTBOX, 4, 4, 273, 56, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER diff --git a/base/applications/utilman/lang/fr-FR.rc b/base/applications/utilman/lang/fr-FR.rc index 78c95eb9315..6f17a5c83ee 100644 --- a/base/applications/utilman/lang/fr-FR.rc +++ b/base/applications/utilman/lang/fr-FR.rc @@ -5,11 +5,12 @@ * COPYRIGHT: Copyright 2019 Pierre Schweitzer (pierre(a)reactos.org) */ +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + IDD_MAIN_DIALOG DIALOGEX 0, 0, 284, 183 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Gestionnaire d'utilitaires d'accessibilité" -LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL FONT 8, "MS Shell Dlg" BEGIN LISTBOX IDC_LISTBOX, 4, 4, 273, 56, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER
5 years, 4 months
1
0
0
0
[reactos] 01/01: [UTILMAN] Add French translation
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a8351727b599eb1668297…
commit a8351727b599eb1668297e9bf457069f43bdb3f6 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Mon Aug 19 13:42:52 2019 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Mon Aug 19 13:42:52 2019 +0200 [UTILMAN] Add French translation --- base/applications/utilman/lang/fr-FR.rc | 54 +++++++++++++++++++++++++++++++++ base/applications/utilman/utilman.rc | 3 ++ media/inf/shortcuts.inf | 2 ++ 3 files changed, 59 insertions(+) diff --git a/base/applications/utilman/lang/fr-FR.rc b/base/applications/utilman/lang/fr-FR.rc new file mode 100644 index 00000000000..78c95eb9315 --- /dev/null +++ b/base/applications/utilman/lang/fr-FR.rc @@ -0,0 +1,54 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: French (France) translation resource + * COPYRIGHT: Copyright 2019 Pierre Schweitzer (pierre(a)reactos.org) + */ + +IDD_MAIN_DIALOG DIALOGEX 0, 0, 284, 183 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Gestionnaire d'utilitaires d'accessibilité" +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL +FONT 8, "MS Shell Dlg" +BEGIN + LISTBOX IDC_LISTBOX, 4, 4, 273, 56, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER + CONTROL "", IDC_GROUPBOX, "Button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 3, 62, 275, 92 + CONTROL "Démarrer", IDC_START, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 76, 45, 16 + CONTROL "Arrêter", IDC_STOP, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 69, 76, 45, 16 + CONTROL "Démarrer automatiquement quand je me connecte", IDC_START_LOG_IN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 101, 206, 14 + CONTROL "Démarrer automatiquement quand je suis sur le bureau", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 + CONTROL "Démarrer automatiquement quand le gestionnaire démarre", IDC_START_UTILMAN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 134, 212, 13 + CONTROL "&OK", IDC_OK, "Button", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 161, 50, 14 + CONTROL "&Annuler", IDC_CANCEL, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 221, 161, 50, 14 + CONTROL "&Aide", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 +END + +IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 +CAPTION "A propos du gestionnaire d'utilitaires d'accessibilité" +FONT 8, "MS Shell Dlg", 0, 0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + ICON IDI_ICON_UTILMAN, IDC_STATIC, 10, 10, 7, 30 + LTEXT "Accessibility Utility Manager\nCopyright (C) 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 48, 7, 150, 36 + LTEXT "Copyright (C) 2019 Hermes Belusca-Maito", IDC_STATIC, 48, 33, 150, 36 + PUSHBUTTON "Close", IDOK, 75, 47, 44, 15 +END + +STRINGTABLE +BEGIN + IDS_OSK "Clavier visuel" + IDS_MAGNIFIER "Loupe" +END + +STRINGTABLE +BEGIN + IDS_NOTRUNNING "%s n'est pas en cours d'exécution" + IDS_RUNNING "%s est en cours d'exécution" + IDS_GROUPBOX_OPTIONS_TITLE "Options pour %s" +END + +STRINGTABLE +BEGIN + IDM_ABOUT "A propos du gestionnaire d'utilitaires d'accessibilité..." +END diff --git a/base/applications/utilman/utilman.rc b/base/applications/utilman/utilman.rc index 50bfa4d710c..02fa4614aa7 100644 --- a/base/applications/utilman/utilman.rc +++ b/base/applications/utilman/utilman.rc @@ -28,5 +28,8 @@ IDI_ICON_UTILMAN ICON "res/utilman.ico" #ifdef LANGUAGE_EN_US #include "lang/en-US.rc" #endif +#ifdef LANGUAGE_FR_FR + #include "lang/fr-FR.rc" +#endif /* EOF */ diff --git a/media/inf/shortcuts.inf b/media/inf/shortcuts.inf index cc59005e55d..d3c0eb8aa3f 100644 --- a/media/inf/shortcuts.inf +++ b/media/inf/shortcuts.inf @@ -579,6 +579,8 @@ WINMINE_TITLE=WineMine WINMINE_DESC=WineMine SPIDER_TITLE=Spider Solitaire SPIDER_DESC=Spider Solitaire +UTILMAN_TITLE=Gestionnaire d'utilitaires d'accessibilité +UTILMAN_DESC=Lance le gestionnaire d'utilitaires d'accessibilité ; Hebrew [Strings.040D]
5 years, 4 months
1
0
0
0
[reactos] 01/01: [DDK][PSDK] Add missing definitions for WPA/WPA2 authentication
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5f6faec2fffb153365d49…
commit 5f6faec2fffb153365d49181e0fd0c840b801fda Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Sun Aug 18 20:16:12 2019 +0300 Commit: Colin Finck <colin(a)reactos.org> CommitDate: Mon Aug 19 13:12:13 2019 +0200 [DDK][PSDK] Add missing definitions for WPA/WPA2 authentication Part of it was already added in 3da616a. CORE-11924 --- sdk/include/psdk/ntddndis.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/sdk/include/psdk/ntddndis.h b/sdk/include/psdk/ntddndis.h index 0ccdfa53096..3da29dffe57 100644 --- a/sdk/include/psdk/ntddndis.h +++ b/sdk/include/psdk/ntddndis.h @@ -45,16 +45,30 @@ typedef enum _NDIS_DEVICE_POWER_STATE { typedef enum _NDIS_802_11_WEP_STATUS { Ndis802_11WEPEnabled, + Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, Ndis802_11WEPDisabled, + Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, Ndis802_11WEPKeyAbsent, - Ndis802_11WEPNotSupported -} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS; + Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, + Ndis802_11WEPNotSupported, + Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, + Ndis802_11Encryption2Enabled, + Ndis802_11Encryption2KeyAbsent, + Ndis802_11Encryption3Enabled, + Ndis802_11Encryption3KeyAbsent +} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, + NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; typedef enum _NDIS_802_11_AUTHENTICATION_MODE { Ndis802_11AuthModeOpen, Ndis802_11AuthModeShared, Ndis802_11AuthModeAutoSwitch, + Ndis802_11AuthModeWPA, + Ndis802_11AuthModeWPAPSK, + Ndis802_11AuthModeWPANone, + Ndis802_11AuthModeWPA2, + Ndis802_11AuthModeWPA2PSK, Ndis802_11AuthModeMax } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE; @@ -141,6 +155,18 @@ typedef struct _NDIS_802_11_WEP UCHAR KeyMaterial[1]; } NDIS_802_11_WEP, *PNDIS_802_11_WEP; +typedef ULONGLONG NDIS_802_11_KEY_RSC; + +typedef struct _NDIS_802_11_KEY +{ + ULONG Length; + ULONG KeyIndex; + ULONG KeyLength; + NDIS_802_11_MAC_ADDRESS BSSID; + NDIS_802_11_KEY_RSC KeyRSC; + UCHAR KeyMaterial[1]; +} NDIS_802_11_KEY, *PNDIS_802_11_KEY; + typedef struct _NDIS_PM_WAKE_UP_CAPABILITIES { NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp; NDIS_DEVICE_POWER_STATE MinPatternWakeUp;
5 years, 4 months
1
0
0
0
[reactos] 01/01: Implement Utility Manager software
by Bișoc George
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df88ea8d25722ca204724…
commit df88ea8d25722ca204724d3a6448c5eb0e82e01d Author: Bișoc George <fraizeraust99(a)gmail.com> AuthorDate: Wed Apr 24 16:06:05 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 13:05:28 2019 +0200 Implement Utility Manager software CORE-15974 --- base/applications/CMakeLists.txt | 1 + base/applications/utilman/CMakeLists.txt | 13 + base/applications/utilman/NOTES.txt | 11 + base/applications/utilman/about.c | 93 +++++++ base/applications/utilman/dialog.c | 438 ++++++++++++++++++++++++++++++ base/applications/utilman/lang/en-US.rc | 54 ++++ base/applications/utilman/precomp.h | 75 +++++ base/applications/utilman/process.c | 189 +++++++++++++ base/applications/utilman/res/utilman.ico | Bin 0 -> 4286 bytes base/applications/utilman/resource.h | 47 ++++ base/applications/utilman/utilman.rc | 32 +++ media/inf/shortcuts.inf | 3 + 12 files changed, 956 insertions(+) diff --git a/base/applications/CMakeLists.txt b/base/applications/CMakeLists.txt index 87cbdbf5e17..74ddde5815c 100644 --- a/base/applications/CMakeLists.txt +++ b/base/applications/CMakeLists.txt @@ -39,6 +39,7 @@ add_subdirectory(shutdown) add_subdirectory(sndrec32) add_subdirectory(sndvol32) add_subdirectory(taskmgr) +add_subdirectory(utilman) add_subdirectory(winhlp32) add_subdirectory(winver) add_subdirectory(wordpad) diff --git a/base/applications/utilman/CMakeLists.txt b/base/applications/utilman/CMakeLists.txt new file mode 100644 index 00000000000..90a909e9dd0 --- /dev/null +++ b/base/applications/utilman/CMakeLists.txt @@ -0,0 +1,13 @@ + +list(APPEND SOURCE + dialog.c + process.c + about.c + precomp.h) + +add_rc_deps(utilman.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/utilman.ico) +add_executable(utilman ${SOURCE} utilman.rc) +set_module_type(utilman win32gui UNICODE) +add_importlibs(utilman comdlg32 user32 gdi32 advapi32 shell32 comctl32 msvcrt kernel32 ntdll) +add_pch(utilman precomp.h SOURCE) +add_cd_file(TARGET utilman DESTINATION reactos/system32 FOR all) diff --git a/base/applications/utilman/NOTES.txt b/base/applications/utilman/NOTES.txt new file mode 100644 index 00000000000..595c089ec1a --- /dev/null +++ b/base/applications/utilman/NOTES.txt @@ -0,0 +1,11 @@ +ReactOS Accessibility Utility Manager +======================================= + +Currently the application can manage the state of the accessibility tools however there are some things which needs to be DONE in order to consider the program as fully complete. The following are: + +- The warning dialog is not implemented YET +- The program can only control the launch/stopping states of accessibility tools, the code which manages the options for each utility is not implemented YET +- Function helper which catches the Windows logo + U keys is not implemented YET +- Registry configuration saver/loader is not implemented YET (XP's Utility Manager creates a key on HKEY_CURRENT_USER\Software\Microsoft with the name "Utility Manager" although the rest of other configuration values for utility options are stored elsewhere and I don't know exactly where are those) +- XP's and Server 2003's main Utility Manager implementation is compiled in a DLL (+ an executable which loads the DLL in question) whereas our Utility Manager is compiled as a whole executable +- On Windows Vista and later, it complains for required elevation to open a process. We need to improve our process creation code and discard ShellExecuteW() \ No newline at end of file diff --git a/base/applications/utilman/about.c b/base/applications/utilman/about.c new file mode 100644 index 00000000000..805fde451f9 --- /dev/null +++ b/base/applications/utilman/about.c @@ -0,0 +1,93 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: About dialog file + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +/* INCLUDES *******************************************************************/ + +#include "precomp.h" + +/* GLOBALS ********************************************************************/ + +UTILMAN_GLOBALS Globals; + +/* FUNCTIONS ******************************************************************/ + +/** + * @AboutDlgProc + * + * "About" dialog procedure. + * + * @param hDlg + * The handle object of the dialog. + * + * @param Msg + * Message events (in unsigned int). + * + * @param wParam + * Message parameter (in UINT_PTR). + * + * @param lParam + * Message paramater (in LONG_PTR). + * + * @return + * Return TRUE if the dialog processed messages, + * FALSE otherwise. + * + */ +INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + switch (Msg) + { + case WM_INITDIALOG: + { + Globals.hIcon = LoadImageW(Globals.hInstance, + MAKEINTRESOURCEW(IDI_ICON_UTILMAN), + IMAGE_ICON, + 0, + 0, + LR_DEFAULTSIZE); + + /* Set the icon within the dialog's title bar */ + if (Globals.hIcon) + { + SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hIcon); + } + + return TRUE; + } + + case WM_COMMAND: + { + case IDOK: + case IDCANCEL: + DestroyIcon(Globals.hIcon); + EndDialog(hDlg, FALSE); + break; + } + } + + return FALSE; +} + +/** + * @ShowAboutDlg + * + * Display the "About" dialog. + * + * @param hDlgParent + * The handle object of the parent dialog. + * + * @return + * Nothing. + */ +VOID ShowAboutDlg(HWND hDlgParent) +{ + /* Display the "About" dialog when the user clicks on the "About" menu item */ + DialogBoxW(Globals.hInstance, + MAKEINTRESOURCEW(IDD_ABOUT_DIALOG), + hDlgParent, + AboutDlgProc); +} diff --git a/base/applications/utilman/dialog.c b/base/applications/utilman/dialog.c new file mode 100644 index 00000000000..4ce74bfa7a6 --- /dev/null +++ b/base/applications/utilman/dialog.c @@ -0,0 +1,438 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Main dialog code file + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + * Copyright 2019 Hermes Belusca-Maito + */ + +/* INCLUDES *******************************************************************/ + +#include "precomp.h" + +/* GLOBALS ********************************************************************/ + +UTILMAN_GLOBALS Globals; + +/* DECLARATIONS ***************************************************************/ + +UTILMAN_STATE EntriesList[] = +{ + {L"magnify.exe", IDS_MAGNIFIER, L"", FALSE}, + {L"osk.exe", IDS_OSK, L"", FALSE} +}; + +/* FUNCTIONS ******************************************************************/ + +/** + * @InitUtilsList + * + * Initializes the list of accessibility utilities. + * + * @param[in] bInitGui + * Whether we are initializing the UI list (TRUE) or the internal array (FALSE). + * + * @return + * Nothing. + */ +VOID InitUtilsList(BOOL bInitGui) +{ + UINT i; + + if (!bInitGui) + { + // TODO: Load the list dynamically from the registry key + // hklm\software\microsoft\windows nt\currentversion\accessibility + + /* Initialize the resource utility strings only once */ + for (i = 0; i < _countof(EntriesList); ++i) + { + LoadStringW(Globals.hInstance, EntriesList[i].uNameId, + EntriesList[i].szResource, _countof(EntriesList[i].szResource)); + + EntriesList[i].bState = FALSE; + } + } + else + { + INT iItem; + BOOL bIsRunning; + WCHAR szFormat[MAX_BUFFER]; + + /* Reset the listbox */ + SendMessageW(Globals.hListDlg, LB_RESETCONTENT, 0, 0); + + /* Add the utilities in the listbox */ + for (i = 0; i < _countof(EntriesList); ++i) + { + bIsRunning = IsProcessRunning(EntriesList[i].lpProgram); + EntriesList[i].bState = bIsRunning; + + /* Load the string and append the utility's name to the format */ + StringCchPrintfW(szFormat, _countof(szFormat), + (bIsRunning ? Globals.szRunning : Globals.szNotRunning), + EntriesList[i].szResource); + + /* Add the item in the listbox */ + iItem = (INT)SendMessageW(Globals.hListDlg, LB_ADDSTRING, 0, (LPARAM)szFormat); + if (iItem != LB_ERR) + SendMessageW(Globals.hListDlg, LB_SETITEMDATA, iItem, (LPARAM)&EntriesList[i]); + } + } +} + +/** + * @DlgInitHandler + * + * Function which processes several operations for WM_INITDIALOG. + * + * @param[in] hDlg + * The handle object of the dialog. + * + * @return + * TRUE to inform the system that WM_INITDIALOG has been processed and + * that it should set the keyboard focus to the control. + * + */ +BOOL DlgInitHandler(IN HWND hDlg) +{ + INT PosX, PosY; + RECT rc; + WCHAR szAboutDlg[MAX_BUFFER]; + HMENU hSysMenu; + + /* Save the dialog handle */ + Globals.hMainDlg = hDlg; + + /* Center the dialog on the screen */ + GetWindowRect(hDlg, &rc); + PosX = (GetSystemMetrics(SM_CXSCREEN) - rc.right) / 2; + PosY = (GetSystemMetrics(SM_CYSCREEN) - rc.bottom) / 2; + SetWindowPos(hDlg, 0, PosX, PosY, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + + /* Load the icon resource */ + Globals.hIcon = LoadImageW(Globals.hInstance, + MAKEINTRESOURCEW(IDI_ICON_UTILMAN), + IMAGE_ICON, + 0, + 0, + LR_DEFAULTSIZE); + + /* Set the icon within the dialog's title bar */ + if (Globals.hIcon) + { + SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hIcon); + } + + /* Retrieve the system menu and append the "About" menu item onto it */ + hSysMenu = GetSystemMenu(hDlg, FALSE); + if (hSysMenu != NULL) + { + if (LoadStringW(Globals.hInstance, IDM_ABOUT, szAboutDlg, _countof(szAboutDlg))) + { + AppendMenuW(hSysMenu, MF_SEPARATOR, 0, NULL); + AppendMenuW(hSysMenu, MF_STRING, IDM_ABOUT, szAboutDlg); + } + } + + /* Get the dialog items, specifically the dialog list box, the Start and Stop buttons */ + Globals.hListDlg = GetDlgItem(hDlg, IDC_LISTBOX); + Globals.hDlgCtlStart = GetDlgItem(hDlg, IDC_START); + Globals.hDlgCtlStop = GetDlgItem(hDlg, IDC_STOP); + + /* Initialize the GUI listbox */ + InitUtilsList(TRUE); + + /* Set the selection to the first item */ + Globals.iSelectedIndex = 0; + + /* Refresh the list */ + ListBoxRefreshContents(); + + /* Create a timer, we'll use it to control the state of our items in the listbox */ + Globals.iTimer = SetTimer(hDlg, 0, 400, NULL); + + return TRUE; +} + +/** + * @GroupBoxUpdateTitle + * + * Updates the title of the groupbox. + * + * @return + * Nothing. + * + */ +VOID GroupBoxUpdateTitle(VOID) +{ + WCHAR szFormat[MAX_BUFFER]; + + /* Format the string with the utility's name and set it to the listbox's title */ + StringCchPrintfW(szFormat, _countof(szFormat), Globals.szGrpBoxTitle, EntriesList[Globals.iSelectedIndex].szResource); + SetWindowTextW(GetDlgItem(Globals.hMainDlg, IDC_GROUPBOX), szFormat); +} + +/** + * @UpdateUtilityState + * + * Checks the state of the given accessibility tool. + * + * @param[in] bUtilState + * State condition (boolean TRUE: started / FALSE: stopped). + * + * @return + * Nothing. + * + */ +VOID UpdateUtilityState(IN BOOL bUtilState) +{ + Button_Enable(Globals.hDlgCtlStart, !bUtilState); + Button_Enable(Globals.hDlgCtlStop, bUtilState); + + /* Update the groupbox's title based on the selected utility item */ + GroupBoxUpdateTitle(); +} + +/** + * @ListBoxRefreshContents + * + * Handle the tasks on a periodic cycle. This function handles WM_TIMER message. + * + * @return + * Returns 0 to inform the system that WM_TIMER has been processed. + * + */ +INT ListBoxRefreshContents(VOID) +{ + UINT i; + INT iItem; + BOOL bIsRunning; + WCHAR szFormat[MAX_BUFFER]; + + /* Disable listbox redraw */ + SendMessageW(Globals.hListDlg, WM_SETREDRAW, FALSE, 0); + + for (i = 0; i < _countof(EntriesList); ++i) + { + /* Check the utility's state */ + bIsRunning = IsProcessRunning(EntriesList[i].lpProgram); + if (bIsRunning != EntriesList[i].bState) + { + /* The utility's state has changed, save it */ + EntriesList[i].bState = bIsRunning; + + /* Update the corresponding item in the listbox */ + StringCchPrintfW(szFormat, _countof(szFormat), + (bIsRunning ? Globals.szRunning : Globals.szNotRunning), + EntriesList[i].szResource); + + SendMessageW(Globals.hListDlg, LB_DELETESTRING, (LPARAM)i, 0); + iItem = SendMessageW(Globals.hListDlg, LB_INSERTSTRING, (LPARAM)i, (LPARAM)szFormat); + if (iItem != LB_ERR) + SendMessageW(Globals.hListDlg, LB_SETITEMDATA, iItem, (LPARAM)&EntriesList[i]); + } + } + + /* Re-enable listbox redraw */ + SendMessageW(Globals.hListDlg, WM_SETREDRAW, TRUE, 0); + + /* + * Check the previously selected item. This will help us determine what + * item has been selected and set its focus selection back. Furthermore, check + * the state of each accessibility tool and enable/disable the buttons. + */ + SendMessageW(Globals.hListDlg, LB_SETCURSEL, (WPARAM)Globals.iSelectedIndex, 0); + UpdateUtilityState(EntriesList[Globals.iSelectedIndex].bState); + + return 0; +} + +/** + * @DlgProc + * + * Main dialog application procedure function. + * + * @param[in] hDlg + * The handle object of the dialog. + * + * @param[in] Msg + * Message events (in unsigned int). + * + * @param[in] wParam + * Message parameter (in UINT_PTR). + * + * @param[in] lParam + * Message paramater (in LONG_PTR). + * + * @return + * Returns 0 to inform the system that the procedure has been handled. + * + */ +INT_PTR APIENTRY DlgProc( + IN HWND hDlg, + IN UINT Msg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + switch (Msg) + { + case WM_INITDIALOG: + DlgInitHandler(hDlg); + return TRUE; + + case WM_CLOSE: + KillTimer(hDlg, Globals.iTimer); + DestroyIcon(Globals.hIcon); + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_OK: + case IDC_CANCEL: + EndDialog(hDlg, FALSE); + break; + + case IDC_LISTBOX: + { + switch (HIWORD(wParam)) + { + case LBN_SELCHANGE: + { + /* Retrieve the index of the current selected item */ + INT iIndex = SendMessageW(Globals.hListDlg, LB_GETCURSEL, 0, 0); + if ((iIndex == LB_ERR) || (iIndex >= _countof(EntriesList))) + break; + + /* Assign the selected index and check the utility's state */ + Globals.iSelectedIndex = iIndex; + UpdateUtilityState(EntriesList[Globals.iSelectedIndex].bState); + break; + } + break; + } + break; + } + + case IDC_START: + LaunchProcess(EntriesList[Globals.iSelectedIndex].lpProgram); + break; + + case IDC_STOP: + CloseProcess(EntriesList[Globals.iSelectedIndex].lpProgram); + break; + + default: + break; + } + break; + } + + case WM_TIMER: + ListBoxRefreshContents(); + return 0; + + case WM_SYSCOMMAND: + { + switch (LOWORD(wParam)) + { + case IDM_ABOUT: + ShowAboutDlg(hDlg); + break; + } + break; + } + } + + return 0; +} + +/** + * @wWinMain + * + * Application entry point. + * + * @param[in] hInstance + * Application instance. + * + * @param[in] hPrevInstance + * The previous instance of the application (not used). + * + * @param[in] pCmdLine + * Pointer to a command line argument (in wide string -- not used). + * + * @param[in] nCmdShow + * An integer served as a flag to note how the application will be shown (not used). + * + * @return + * Returns 0 to let the function terminating before it enters in the message loop. + * + */ +INT WINAPI wWinMain( + IN HINSTANCE hInstance, + IN HINSTANCE hPrevInstance, + IN LPWSTR pCmdLine, + IN INT nCmdShow) +{ + HANDLE hMutex; + DWORD dwError; + INITCOMMONCONTROLSEX iccex; + + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(pCmdLine); + UNREFERENCED_PARAMETER(nCmdShow); + + /* Create a mutant object for the program. */ + hMutex = CreateMutexW(NULL, FALSE, L"Utilman"); + if (hMutex) + { + /* Check if there's already a mutex for the program */ + dwError = GetLastError(); + if (dwError == ERROR_ALREADY_EXISTS) + { + /* + The program's instance is already here. That means + the program is running and we should not set a new instance + and mutex object. + */ + CloseHandle(hMutex); + return 0; + } + } + + /* Load the common controls for the program */ + iccex.dwSize = sizeof(INITCOMMONCONTROLSEX); + iccex.dwICC = ICC_STANDARD_CLASSES | ICC_WIN95_CLASSES; + InitCommonControlsEx(&iccex); + + /* Initialize the globals */ + ZeroMemory(&Globals, sizeof(Globals)); + Globals.hInstance = hInstance; + + LoadStringW(Globals.hInstance, IDS_RUNNING, + Globals.szRunning, _countof(Globals.szRunning)); + LoadStringW(Globals.hInstance, IDS_NOTRUNNING, + Globals.szNotRunning, _countof(Globals.szNotRunning)); + LoadStringW(Globals.hInstance, IDS_GROUPBOX_OPTIONS_TITLE, + Globals.szGrpBoxTitle, _countof(Globals.szGrpBoxTitle)); + + /* Initialize the list of accessibility utilities */ + InitUtilsList(FALSE); + + /* Create the dialog box of the program */ + DialogBoxW(hInstance, + MAKEINTRESOURCEW(IDD_MAIN_DIALOG), + GetDesktopWindow(), + DlgProc); + + /* Delete the mutex */ + if (hMutex) + { + CloseHandle(hMutex); + } + + return 0; +} diff --git a/base/applications/utilman/lang/en-US.rc b/base/applications/utilman/lang/en-US.rc new file mode 100644 index 00000000000..582c69b57c3 --- /dev/null +++ b/base/applications/utilman/lang/en-US.rc @@ -0,0 +1,54 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: English (United States of America) translation resource + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +IDD_MAIN_DIALOG DIALOGEX 0, 0, 284, 183 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Accessibility Utility Manager" +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +FONT 8, "MS Shell Dlg" +BEGIN + LISTBOX IDC_LISTBOX, 4, 4, 273, 56, LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER + CONTROL "", IDC_GROUPBOX, "Button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 3, 62, 275, 92 + CONTROL "Start", IDC_START, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 76, 45, 16 + CONTROL "Stop", IDC_STOP, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 69, 76, 45, 16 + CONTROL "Start automatically when I log in", IDC_START_LOG_IN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 101, 206, 14 + CONTROL "Start automatically when I look my desktop", IDC_START_DESKTOP, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 118, 212, 14 + CONTROL "Start automatically when Utility Manager starts", IDC_START_UTILMAN, "Button", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 12, 134, 212, 13 + CONTROL "&OK", IDC_OK, "Button", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 160, 161, 50, 14 + CONTROL "&Cancel", IDC_CANCEL, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 221, 161, 50, 14 + CONTROL "&Help", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 +END + +IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 +CAPTION "About Accessibility Utility Manager" +FONT 8, "MS Shell Dlg", 0, 0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + ICON IDI_ICON_UTILMAN, IDC_STATIC, 10, 10, 7, 30 + LTEXT "Accessibility Utility Manager\nCopyright (C) 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 48, 7, 150, 36 + LTEXT "Copyright (C) 2019 Hermes Belusca-Maito", IDC_STATIC, 48, 33, 150, 36 + PUSHBUTTON "Close", IDOK, 75, 47, 44, 15 +END + +STRINGTABLE +BEGIN + IDS_OSK "On-Screen Keyboard" + IDS_MAGNIFIER "Magnifier" +END + +STRINGTABLE +BEGIN + IDS_NOTRUNNING "%s is not running" + IDS_RUNNING "%s is running" + IDS_GROUPBOX_OPTIONS_TITLE "Options for %s" +END + +STRINGTABLE +BEGIN + IDM_ABOUT "About Accessibility Utility Manager..." +END diff --git a/base/applications/utilman/precomp.h b/base/applications/utilman/precomp.h new file mode 100644 index 00000000000..db665e793c2 --- /dev/null +++ b/base/applications/utilman/precomp.h @@ -0,0 +1,75 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Pre-compiled header file + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +#ifndef _UTILMAN_H +#define _UTILMAN_H + +/* INCLUDES ******************************************************************/ + +#include <stdlib.h> +#include <windows.h> +#include <commctrl.h> +#include <tlhelp32.h> +#include <windowsx.h> +#include <debug.h> +#include <wchar.h> +#include <strsafe.h> + +#include "resource.h" + +/* DEFINES ********************************************************************/ + +#define MAX_BUFFER 256 + +/* TYPES **********************************************************************/ + +typedef struct +{ + HINSTANCE hInstance; + HICON hIcon; + UINT_PTR iTimer; + INT iSelectedIndex; + HWND hDlgCtlStart; + HWND hDlgCtlStop; + HWND hListDlg; + HWND hMainDlg; + WCHAR szRunning[MAX_BUFFER]; + WCHAR szNotRunning[MAX_BUFFER]; + WCHAR szGrpBoxTitle[MAX_BUFFER]; +} UTILMAN_GLOBALS; + +typedef struct _UTILMAN_STATE +{ + LPCWSTR lpProgram; + UINT uNameId; + WCHAR szResource[MAX_BUFFER]; + BOOL bState; +} UTILMAN_STATE, *PUTILMAN_STATE; + +/* DECLARATIONS ***************************************************************/ + +/* dialog.c */ +BOOL DlgInitHandler(HWND hDlg); +INT_PTR APIENTRY DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); +INT ListBoxRefreshContents(VOID); +VOID CheckUtilityState(BOOL bUtilState); + +/* process.c */ +BOOL IsProcessRunning(IN LPCWSTR lpProcessName); +BOOL LaunchProcess(LPCWSTR lpProcessName); +BOOL CloseProcess(IN LPCWSTR lpProcessName); + +/* about.c */ +VOID ShowAboutDlg(HWND hDlgParent); +INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); + +/* Struct variable declaration */ +extern UTILMAN_GLOBALS Globals; + +#endif /* _UTILMAN_H */ + +/* EOF */ diff --git a/base/applications/utilman/process.c b/base/applications/utilman/process.c new file mode 100644 index 00000000000..45bae49276f --- /dev/null +++ b/base/applications/utilman/process.c @@ -0,0 +1,189 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Process handling functions + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +/* INCLUDES *******************************************************************/ + +#include "precomp.h" + +/* FUNCTIONS ******************************************************************/ + +/** + * @IsProcessRunning + * + * Checks if a process is running. + * + * @param[in] ProcName + * The name of the executable process. + * + * @return + * Returns TRUE if the given process' name is running, + * FALSE otherwise. + * + */ +BOOL IsProcessRunning(IN LPCWSTR lpProcessName) +{ + BOOL bIsRunning = FALSE; + PROCESSENTRY32W Process = {0}; + + /* Create a snapshot and check whether the given process' executable name is running */ + HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + + if (hSnapshot == INVALID_HANDLE_VALUE) + return FALSE; + + Process.dwSize = sizeof(Process); + + /* Enumerate the processes */ + if (Process32FirstW(hSnapshot, &Process)) + { + do + { + if (_wcsicmp(Process.szExeFile, lpProcessName) == 0) + { + /* The process we are searching for is running */ + bIsRunning = TRUE; + break; + } + } + while (Process32NextW(hSnapshot, &Process)); + } + + /* Free the handle and return */ + CloseHandle(hSnapshot); + return bIsRunning; +} + +/** + * @LaunchProcess + * + * Executes a process. + * + * @param[in] lpProcessName + * The name of the executable process. + * + * @return + * Returns TRUE if the process has been launched successfully, + * FALSE otherwise. + * + */ +BOOL LaunchProcess(LPCWSTR lpProcessName) +{ + STARTUPINFOW si; + PROCESS_INFORMATION pi; + HANDLE hUserToken, hProcessToken; + BOOL bSuccess; + WCHAR ExpandedCmdLine[MAX_PATH]; + + /* Expand the process path string */ + ExpandEnvironmentStringsW(lpProcessName, ExpandedCmdLine, ARRAYSIZE(ExpandedCmdLine)); + + ZeroMemory(&pi, sizeof(pi)); + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + si.dwFlags = STARTF_USESHOWWINDOW; + si.wShowWindow = SW_SHOWNORMAL; + + /* Get the token of the parent (current) process of the application */ + bSuccess = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_DUPLICATE, &hUserToken); + if (!bSuccess) + { + DPRINT("OpenProcessToken() failed with error -> %lu\n", GetLastError()); + return FALSE; + } + + /* Duplicate a new token so that we can use it to create our process */ + bSuccess = DuplicateTokenEx(hUserToken, TOKEN_ALL_ACCESS, NULL, SecurityIdentification, TokenPrimary, &hProcessToken); + if (!bSuccess) + { + DPRINT("DuplicateTokenEx() failed with error -> %lu\n", GetLastError()); + CloseHandle(hUserToken); + return FALSE; + } + + /* Finally create the process */ + bSuccess = CreateProcessAsUserW(hProcessToken, + NULL, + ExpandedCmdLine, + NULL, + NULL, + FALSE, + 0, // DETACHED_PROCESS, NORMAL_PRIORITY_CLASS + NULL, + NULL, + &si, + &pi); + + if (!bSuccess) + { + DPRINT("CreateProcessAsUserW() failed with error -> %lu\n", GetLastError()); + CloseHandle(hUserToken); + CloseHandle(hProcessToken); + return FALSE; + } + + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + CloseHandle(hUserToken); + CloseHandle(hProcessToken); + return TRUE; +} + +/** + * @CloseProcess + * + * Closes a process. + * + * @param[in] lpProcessName + * The name of the executable process. + * + * @return + * Returns TRUE if the process has been terminated successfully, + * FALSE otherwise. + * + */ +BOOL CloseProcess(IN LPCWSTR lpProcessName) +{ + BOOL bSuccess = FALSE; + PROCESSENTRY32W Process = {0}; + + /* Create a snapshot and check if the given process' executable name is running */ + HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + + if (hSnapshot == INVALID_HANDLE_VALUE) + return FALSE; + + Process.dwSize = sizeof(Process); + + /* Enumerate the processes */ + if (Process32FirstW(hSnapshot, &Process)) + { + do + { + if (_wcsicmp(Process.szExeFile, lpProcessName) == 0) + { + /* + * We have found the process. However we must make + * sure that we DO NOT kill ourselves (the process ID + * matching with the current parent process ID). + */ + HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0, Process.th32ProcessID); + if ((hProcess != NULL) && (Process.th32ProcessID != GetCurrentProcessId())) + { + TerminateProcess(hProcess, 0); + CloseHandle(hProcess); + } + bSuccess = TRUE; + break; + } + } + while (Process32NextW(hSnapshot, &Process)); + } + + /* Free the handle and return */ + CloseHandle(hSnapshot); + return bSuccess; +} diff --git a/base/applications/utilman/res/utilman.ico b/base/applications/utilman/res/utilman.ico new file mode 100644 index 00000000000..9f37366fb10 Binary files /dev/null and b/base/applications/utilman/res/utilman.ico differ diff --git a/base/applications/utilman/resource.h b/base/applications/utilman/resource.h new file mode 100644 index 00000000000..df93ab48ad9 --- /dev/null +++ b/base/applications/utilman/resource.h @@ -0,0 +1,47 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Resource header file + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +#pragma once + +#define IDC_STATIC -1 + +/* Icon resource */ +#define IDI_ICON_UTILMAN 50 + +/* List box resource */ +#define IDC_LISTBOX 60 + +/* Utility tools name strings */ +#define IDS_OSK 100 +#define IDS_MAGNIFIER 101 + +/* Utility state strings */ +#define IDS_NOTRUNNING 150 +#define IDS_RUNNING 151 + +/* Groupbox option title */ +#define IDC_GROUPBOX 200 +#define IDS_GROUPBOX_OPTIONS_TITLE 201 + +/* Button resources */ +#define IDC_START 300 +#define IDC_STOP 301 +#define IDC_OK 302 +#define IDC_CANCEL 303 +#define IDC_HELP_TOPICS 304 + +/* Checkbox resources */ +#define IDC_START_LOG_IN 400 +#define IDC_START_DESKTOP 401 +#define IDC_START_UTILMAN 402 + +/* System menu (About) resource */ +#define IDM_ABOUT 600 + +/* Main dialog resource */ +#define IDD_MAIN_DIALOG 1000 +#define IDD_ABOUT_DIALOG 1050 diff --git a/base/applications/utilman/utilman.rc b/base/applications/utilman/utilman.rc new file mode 100644 index 00000000000..50bfa4d710c --- /dev/null +++ b/base/applications/utilman/utilman.rc @@ -0,0 +1,32 @@ +/* + * PROJECT: ReactOS Utility Manager (Accessibility) + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Main resource file + * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com) + */ + +/* INCLUDES ******************************************************************/ + +#include <windef.h> +#include <winuser.h> +#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Accessibility Utility Manager" +#define REACTOS_STR_INTERNAL_NAME "utilman" +#define REACTOS_STR_ORIGINAL_FILENAME "utilman.exe" +#include <reactos/version.rc> + +IDI_ICON_UTILMAN ICON "res/utilman.ico" + +#include <reactos/manifest_exe.rc> + +/* UTF-8 */ +#pragma code_page(65001) + +#ifdef LANGUAGE_EN_US + #include "lang/en-US.rc" +#endif + +/* EOF */ diff --git a/media/inf/shortcuts.inf b/media/inf/shortcuts.inf index f6e3a4c0977..cc59005e55d 100644 --- a/media/inf/shortcuts.inf +++ b/media/inf/shortcuts.inf @@ -50,6 +50,7 @@ QuickLaunchShortcuts=26, Microsoft\Internet Explorer\Quick Launch [AccessibilityShortcuts] %SystemRoot%\system32\magnify.exe, %MAGNIFY_TITLE%, %MAGNIFY_DESC%, 0, %HOMEDRIVE%%HOMEPATH% %SystemRoot%\system32\osk.exe, %OSK_TITLE%, %OSK_DESC%, 0, %HOMEDRIVE%%HOMEPATH% +%SystemRoot%\system32\utilman.exe, %UTILMAN_TITLE%, %UTILMAN_DESC%, 0, %HOMEDRIVE%%HOMEPATH% [EntertainmentShortcuts] %SystemRoot%\system32\mplay32.exe, %MPLAY_TITLE%, %MPLAY_DESC%, 0, %HOMEDRIVE%%HOMEPATH% @@ -133,6 +134,8 @@ WINMINE_TITLE=WineMine WINMINE_DESC=WineMine SPIDER_TITLE=Spider Solitaire SPIDER_DESC=Spider Solitaire +UTILMAN_TITLE=Accessibility Utility Manager +UTILMAN_DESC=Launch Accessibility Utility Manager ; Bulgarian [Strings.0402]
5 years, 4 months
1
0
0
0
[reactos] 01/01: [SHELL32][STOBJECT] Enforce ShellExecuteW(..., file, parameters, ...)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb77f1701fea36e872a0b…
commit cb77f1701fea36e872a0be3a3a89b324cce4748c Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Thu Aug 15 22:21:21 2019 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 19 13:01:08 2019 +0200 [SHELL32][STOBJECT] Enforce ShellExecuteW(..., file, parameters, ...) CORE-16299 --- dll/shellext/stobject/hotplug.cpp | 7 ++++++- dll/shellext/stobject/volume.cpp | 7 ++++++- dll/win32/shell32/folders/CDrivesFolder.cpp | 7 ++++++- dll/win32/shell32/folders/CRegFolder.cpp | 29 ++++++++++++++++++++++++----- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/dll/shellext/stobject/hotplug.cpp b/dll/shellext/stobject/hotplug.cpp index 03348f92d2f..b2202c99d44 100644 --- a/dll/shellext/stobject/hotplug.cpp +++ b/dll/shellext/stobject/hotplug.cpp @@ -155,7 +155,12 @@ HRESULT STDMETHODCALLTYPE Hotplug_Shutdown(_In_ CSysTray * pSysTray) static void _RunHotplug(CSysTray * pSysTray) { - ShellExecuteW(pSysTray->GetHWnd(), L"open", L"rundll32.exe shell32.dll,Control_RunDLL hotplug.dll", NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(pSysTray->GetHWnd(), + L"open", + L"rundll32.exe", + L"shell32.dll,Control_RunDLL hotplug.dll", + NULL, + SW_SHOWNORMAL); } static void _ShowContextMenu(CSysTray * pSysTray) diff --git a/dll/shellext/stobject/volume.cpp b/dll/shellext/stobject/volume.cpp index 04723a7be26..4b63e05a6b1 100644 --- a/dll/shellext/stobject/volume.cpp +++ b/dll/shellext/stobject/volume.cpp @@ -211,7 +211,12 @@ HRESULT Volume_OnDeviceChange(_In_ CSysTray * pSysTray, WPARAM wParam, LPARAM lP static void _RunVolume(BOOL bTray) { - ShellExecuteW(NULL, NULL, bTray ? L"sndvol32.exe /t" : L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(NULL, + NULL, + L"sndvol32.exe", + bTray ? L"/t" : NULL, + NULL, + SW_SHOWNORMAL); } static void _RunMMCpl() diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp b/dll/win32/shell32/folders/CDrivesFolder.cpp index 15ccef2da80..17542eeea41 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -1087,7 +1087,12 @@ HRESULT WINAPI CDrivesFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IDataO if (uMsg == DFM_INVOKECOMMAND && wParam == 1) // #1 { // "System" properties - ShellExecuteW(hwndOwner, NULL, L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(hwndOwner, + NULL, + L"rundll32.exe", + L"shell32.dll,Control_RunDLL sysdm.cpl", + NULL, + SW_SHOWNORMAL); } else if (uMsg == DFM_MERGECONTEXTMENU) { diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp index fc8eba29fe7..33539816b11 100644 --- a/dll/win32/shell32/folders/CRegFolder.cpp +++ b/dll/win32/shell32/folders/CRegFolder.cpp @@ -41,21 +41,40 @@ HRESULT CALLBACK RegFolderContextMenuCallback(IShellFolder *psf, if (_ILIsMyComputer(apidl[0])) { - if (32 >= (UINT_PTR)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL)) + if (32 >= (UINT_PTR)ShellExecuteW(hwnd, + L"open", + L"rundll32.exe", + L"shell32.dll,Control_RunDLL sysdm.cpl", + NULL, + SW_SHOWNORMAL)) + { hr = E_FAIL; + } } else if (_ILIsDesktop(apidl[0])) { - if (32 >= (UINT_PTR)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL)) + if (32 >= (UINT_PTR)ShellExecuteW(hwnd, + L"open", + L"rundll32.exe", + L"shell32.dll,Control_RunDLL desk.cpl", + NULL, + SW_SHOWNORMAL)) + { hr = E_FAIL; + } } else if (_ILIsNetHood(apidl[0])) { // FIXME path! - if (32 >= (UINT_PTR)ShellExecuteW(NULL, L"open", L"explorer.exe", - L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", - NULL, SW_SHOWDEFAULT)) + if (32 >= (UINT_PTR)ShellExecuteW(NULL, + L"open", + L"explorer.exe", + L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", + NULL, + SW_SHOWDEFAULT)) + { hr = E_FAIL; + } } else if (_ILIsBitBucket(apidl[0])) {
5 years, 4 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
29
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
Results per page:
10
25
50
100
200