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
March 2022
----- 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
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 01/360: [WINESYNC] msi: Stop vending WineMsiRemotePackage.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5f9ac3b855116af3252e…
commit a5f9ac3b855116af3252e31dd4776671fa4d5511 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:43 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:33 2022 +0100 [WINESYNC] msi: Stop vending WineMsiRemotePackage. Since we return it from WineMsiRemoteCustomAction::GetActionInfo(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id d26336a944e0b516e56dd69fa06543404402b45f by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msi_main.c | 7 ------- dll/win32/msi/msiserver.idl | 5 ----- 2 files changed, 12 deletions(-) diff --git a/dll/win32/msi/msi_main.c b/dll/win32/msi/msi_main.c index 31431180ea3..9f5b2c4a547 100644 --- a/dll/win32/msi/msi_main.c +++ b/dll/win32/msi/msi_main.c @@ -167,7 +167,6 @@ static const IClassFactoryVtbl MsiCF_Vtbl = static IClassFactoryImpl MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver }; static IClassFactoryImpl WineMsiCustomRemote_CF = { { &MsiCF_Vtbl }, create_msi_custom_remote }; -static IClassFactoryImpl WineMsiRemotePackage_CF = { { &MsiCF_Vtbl }, create_msi_remote_package }; /****************************************************************** * DllGetClassObject [MSI.@] @@ -188,12 +187,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) return S_OK; } - if ( IsEqualCLSID (rclsid, &CLSID_WineMsiRemotePackage) ) - { - *ppv = &WineMsiRemotePackage_CF; - return S_OK; - } - if( IsEqualCLSID (rclsid, &CLSID_MsiServerMessage) || IsEqualCLSID (rclsid, &CLSID_MsiServer) || IsEqualCLSID (rclsid, &CLSID_PSFactoryBuffer) || diff --git a/dll/win32/msi/msiserver.idl b/dll/win32/msi/msiserver.idl index 50526024a27..e7346905074 100644 --- a/dll/win32/msi/msiserver.idl +++ b/dll/win32/msi/msiserver.idl @@ -187,11 +187,6 @@ coclass MsiServerX3 { interface IMsiServer; } ] coclass WineMsiRemoteCustomAction { interface WineMsiRemoteCustomAction; } -[ - uuid(902b3592-9d08-4dfd-a593-d07c52546421) -] -coclass WineMsiRemotePackage { interface WineMsiRemotePackage; } - [ uuid(000C1092-0000-0000-C000-000000000046), version(1.0) ] library WindowsInstaller {
2 years, 9 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] Improve UpdateServiceStatus()
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=691a739b0246947938ef5…
commit 691a739b0246947938ef5ccc51ef9379d6320671 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Mar 20 17:21:45 2022 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Mar 20 17:21:45 2022 +0100 [UMPNPMGR] Improve UpdateServiceStatus() - Set dwCheckPoint - Set dwControlAccepted depending on the service state --- base/services/umpnpmgr/umpnpmgr.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c index 826efbde66b..67ba42fe82d 100644 --- a/base/services/umpnpmgr/umpnpmgr.c +++ b/base/services/umpnpmgr/umpnpmgr.c @@ -22,7 +22,7 @@ * FILE: base/services/umpnpmgr/umpnpmgr.c * PURPOSE: User-mode Plug and Play manager * PROGRAMMER: Eric Kohl (eric.kohl(a)reactos.org) - * Herv� Poussineau (hpoussin(a)reactos.org) + * Hervé Poussineau (hpoussin(a)reactos.org) * Colin Finck (colin(a)reactos.org) */ @@ -205,14 +205,20 @@ PnpEventThread(LPVOID lpParameter) static VOID -UpdateServiceStatus(DWORD dwState) +UpdateServiceStatus( + _In_ DWORD dwState, + _In_ DWORD dwCheckPoint) { ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ServiceStatus.dwCurrentState = dwState; - ServiceStatus.dwControlsAccepted = 0; ServiceStatus.dwWin32ExitCode = 0; ServiceStatus.dwServiceSpecificExitCode = 0; - ServiceStatus.dwCheckPoint = 0; + ServiceStatus.dwCheckPoint = dwCheckPoint; + + if (dwState == SERVICE_RUNNING) + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN; + else + ServiceStatus.dwControlsAccepted = 0; if (dwState == SERVICE_START_PENDING || dwState == SERVICE_STOP_PENDING || @@ -239,19 +245,20 @@ ServiceControlHandler(DWORD dwControl, { case SERVICE_CONTROL_STOP: DPRINT1(" SERVICE_CONTROL_STOP received\n"); + UpdateServiceStatus(SERVICE_STOP_PENDING, 1); /* Stop listening to RPC Messages */ RpcMgmtStopServerListening(NULL); - UpdateServiceStatus(SERVICE_STOPPED); + UpdateServiceStatus(SERVICE_STOPPED, 0); return ERROR_SUCCESS; case SERVICE_CONTROL_PAUSE: DPRINT1(" SERVICE_CONTROL_PAUSE received\n"); - UpdateServiceStatus(SERVICE_PAUSED); + UpdateServiceStatus(SERVICE_PAUSED, 0); return ERROR_SUCCESS; case SERVICE_CONTROL_CONTINUE: DPRINT1(" SERVICE_CONTROL_CONTINUE received\n"); - UpdateServiceStatus(SERVICE_RUNNING); + UpdateServiceStatus(SERVICE_RUNNING, 0); return ERROR_SUCCESS; case SERVICE_CONTROL_INTERROGATE: @@ -262,9 +269,10 @@ ServiceControlHandler(DWORD dwControl, case SERVICE_CONTROL_SHUTDOWN: DPRINT1(" SERVICE_CONTROL_SHUTDOWN received\n"); + UpdateServiceStatus(SERVICE_STOP_PENDING, 1); /* Stop listening to RPC Messages */ RpcMgmtStopServerListening(NULL); - UpdateServiceStatus(SERVICE_STOPPED); + UpdateServiceStatus(SERVICE_STOPPED, 0); return ERROR_SUCCESS; default : @@ -365,7 +373,7 @@ ServiceMain(DWORD argc, LPTSTR *argv) return; } - UpdateServiceStatus(SERVICE_START_PENDING); + UpdateServiceStatus(SERVICE_START_PENDING, 1); hThread = CreateThread(NULL, 0, @@ -376,6 +384,8 @@ ServiceMain(DWORD argc, LPTSTR *argv) if (hThread != NULL) CloseHandle(hThread); + UpdateServiceStatus(SERVICE_START_PENDING, 2); + hThread = CreateThread(NULL, 0, RpcServerThread, @@ -385,6 +395,8 @@ ServiceMain(DWORD argc, LPTSTR *argv) if (hThread != NULL) CloseHandle(hThread); + UpdateServiceStatus(SERVICE_START_PENDING, 3); + hThread = CreateThread(NULL, 0, DeviceInstallThread, @@ -394,7 +406,7 @@ ServiceMain(DWORD argc, LPTSTR *argv) if (hThread != NULL) CloseHandle(hThread); - UpdateServiceStatus(SERVICE_RUNNING); + UpdateServiceStatus(SERVICE_RUNNING, 0); DPRINT("ServiceMain() done\n"); }
2 years, 9 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR][SETUPAPI] Fix notification handles in PNP_RegisterNotification and PNP_UnregisterNotification
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b0a73746cd627846c2a20…
commit b0a73746cd627846c2a208a168f1c1bd705e8a05 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Mar 20 14:59:30 2022 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Mar 20 14:59:30 2022 +0100 [UMPNPMGR][SETUPAPI] Fix notification handles in PNP_RegisterNotification and PNP_UnregisterNotification - Notification handles must be context handles - Register and unregister notification targets --- base/services/umpnpmgr/precomp.h | 8 +++- base/services/umpnpmgr/rpcserver.c | 80 ++++++++++++++++++++++++++------------ dll/win32/setupapi/cfgmgr.c | 13 +++++-- sdk/include/reactos/idl/pnp.idl | 7 +++- 4 files changed, 77 insertions(+), 31 deletions(-) diff --git a/base/services/umpnpmgr/precomp.h b/base/services/umpnpmgr/precomp.h index 82035203441..7977db7b568 100644 --- a/base/services/umpnpmgr/precomp.h +++ b/base/services/umpnpmgr/precomp.h @@ -4,7 +4,7 @@ * FILE: base/services/umpnpmgr/install.c * PURPOSE: Device installer * PROGRAMMER: Eric Kohl (eric.kohl(a)reactos.org) - * Herv� Poussineau (hpoussin(a)reactos.org) + * Hervé Poussineau (hpoussin(a)reactos.org) * Colin Finck (colin(a)reactos.org) */ @@ -39,6 +39,12 @@ typedef struct WCHAR DeviceIds[ANYSIZE_ARRAY]; } DeviceInstallParams; +typedef struct +{ + LIST_ENTRY ListEntry; + PWSTR pszName; +} NOTIFY_ENTRY, *PNOTIFY_ENTRY; + /* install.c */ extern HANDLE hUserToken; diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index 95f69db2470..34bdf848966 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -38,6 +38,7 @@ static WCHAR szRootDeviceInstanceID[] = L"HTREE\\ROOT\\0"; +LIST_ENTRY NotificationListHead; /* FUNCTIONS *****************************************************************/ @@ -51,6 +52,8 @@ RpcServerThread(LPVOID lpParameter) DPRINT("RpcServerThread() called\n"); + InitializeListHead(&NotificationListHead); + #if 0 /* 2k/XP/2k3-compatible protocol sequence/endpoint */ Status = RpcServerUseProtseqEpW(L"ncacn_np", @@ -535,6 +538,15 @@ GetConfigurationData( } +VOID +__RPC_USER +PNP_NOTIFY_HANDLE_rundown( + PNP_NOTIFY_HANDLE pHandle) +{ + DPRINT1("PNP_NOTIFY_HANDLE_rundown(%p)\n", pHandle); +} + + /* PUBLIC FUNCTIONS **********************************************************/ /* Function 0 */ @@ -4461,22 +4473,24 @@ PNP_RegisterNotification( BYTE *pNotificationFilter, DWORD ulNotificationFilterSize, DWORD ulFlags, - DWORD *pulNotify, + PNP_NOTIFY_HANDLE *pNotifyHandle, DWORD ulUnknown8, DWORD *pulUnknown9) { PDEV_BROADCAST_DEVICEINTERFACE_W pBroadcastDeviceInterface; PDEV_BROADCAST_HANDLE pBroadcastDeviceHandle; -#if 0 - PNOTIFY_DATA pNotifyData; -#endif + PNOTIFY_ENTRY pNotifyData = NULL; DPRINT1("PNP_RegisterNotification(%p %lx '%S' %p %lu 0x%lx %p %lx %p)\n", hBinding, ulUnknown2, pszName, pNotificationFilter, - ulNotificationFilterSize, ulFlags, pulNotify, ulUnknown8, pulUnknown9); + ulNotificationFilterSize, ulFlags, pNotifyHandle, ulUnknown8, pulUnknown9); + + if (pNotifyHandle == NULL) + return CR_INVALID_POINTER; + + *pNotifyHandle = NULL; if (pNotificationFilter == NULL || - pulNotify == NULL || pulUnknown9 == NULL) return CR_INVALID_POINTER; @@ -4495,6 +4509,28 @@ PNP_RegisterNotification( if ((ulNotificationFilterSize < sizeof(DEV_BROADCAST_DEVICEINTERFACE_W)) || (pBroadcastDeviceInterface->dbcc_size < sizeof(DEV_BROADCAST_DEVICEINTERFACE_W))) return CR_INVALID_DATA; + + pNotifyData = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NOTIFY_ENTRY)); + if (pNotifyData == NULL) + return CR_OUT_OF_MEMORY; + + if (pszName != NULL) + { + pNotifyData->pszName = RtlAllocateHeap(GetProcessHeap(), + HEAP_ZERO_MEMORY, + (wcslen(pszName) + 1) * sizeof(WCHAR)); + if (pNotifyData->pszName == NULL) + { + RtlFreeHeap(GetProcessHeap(), 0, pNotifyData); + return CR_OUT_OF_MEMORY; + } + } + + /* Add the entry to the notification list */ + InsertTailList(&NotificationListHead, &pNotifyData->ListEntry); + + DPRINT("pNotifyData: %p\n", pNotifyData); + *pNotifyHandle = (PNP_NOTIFY_HANDLE)pNotifyData; } else if (((PDEV_BROADCAST_HDR)pNotificationFilter)->dbch_devicetype == DBT_DEVTYP_HANDLE) { @@ -4514,17 +4550,6 @@ PNP_RegisterNotification( return CR_INVALID_DATA; } - -#if 0 - pNotifyData = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NOTIFY_DATA)); - if (pNotifyData == NULL) - return CR_OUT_OF_MEMORY; - - *pulNotify = (DWORD)pNotifyData; -#endif - - *pulNotify = 1; - return CR_SUCCESS; } @@ -4534,15 +4559,22 @@ DWORD WINAPI PNP_UnregisterNotification( handle_t hBinding, - DWORD ulNotify) + PNP_NOTIFY_HANDLE *pNotifyHandle) { - DPRINT1("PNP_UnregisterNotification(%p 0x%lx)\n", - hBinding, ulNotify); + PNOTIFY_ENTRY pEntry; -#if 0 - UNIMPLEMENTED; - return CR_CALL_NOT_IMPLEMENTED; -#endif + DPRINT1("PNP_UnregisterNotification(%p %p)\n", + hBinding, pNotifyHandle); + + pEntry = (PNOTIFY_ENTRY)*pNotifyHandle; + if (pEntry == NULL) + return CR_INVALID_DATA; + + RemoveEntryList(&pEntry->ListEntry); + if (pEntry->pszName) + RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry->pszName); + RtlFreeHeap(RtlGetProcessHeap(), 0, pEntry); + *pNotifyHandle = NULL; return CR_SUCCESS; } diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index b6827bc6925..e411c887f75 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -74,7 +74,7 @@ typedef struct _LOG_CONF_INFO typedef struct _NOTIFY_DATA { ULONG ulMagic; - ULONG ulNotifyData; + PVOID hNotifyHandle; } NOTIFY_DATA, *PNOTIFY_DATA; #define NOTIFY_MAGIC 0x44556677 @@ -634,6 +634,7 @@ CMP_RegisterNotification( return CR_OUT_OF_MEMORY; pNotifyData->ulMagic = NOTIFY_MAGIC; + pNotifyData->hNotifyHandle = NULL; if ((ulFlags & DEVICE_NOTIFY_SERVICE_HANDLE) == DEVICE_NOTIFY_WINDOW_HANDLE) { @@ -674,7 +675,7 @@ CMP_RegisterNotification( (BYTE*)lpvNotificationFilter, ((DEV_BROADCAST_HDR*)lpvNotificationFilter)->dbch_size, ulFlags, - &pNotifyData->ulNotifyData, + &pNotifyData->hNotifyHandle, GetCurrentProcessId(), &ulUnknown9); /* ??? */ } @@ -686,11 +687,12 @@ CMP_RegisterNotification( if (ret == CR_SUCCESS) { + TRACE("hNotifyHandle: %p\n", pNotifyData->hNotifyHandle); *phDevNotify = (HDEVNOTIFY)pNotifyData; } else { - if (pNotifyData != NULL) + if (pNotifyData->hNotifyHandle == NULL) HeapFree(GetProcessHeap(), 0, pNotifyData); *phDevNotify = (HDEVNOTIFY)NULL; @@ -774,7 +776,7 @@ CMP_UnregisterNotification( RpcTryExcept { ret = PNP_UnregisterNotification(BindingHandle, - pNotifyData->ulNotifyData); + &pNotifyData->hNotifyHandle); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) { @@ -783,7 +785,10 @@ CMP_UnregisterNotification( RpcEndExcept; if (ret == CR_SUCCESS) + { + pNotifyData->hNotifyHandle = NULL; HeapFree(GetProcessHeap(), 0, pNotifyData); + } return ret; } diff --git a/sdk/include/reactos/idl/pnp.idl b/sdk/include/reactos/idl/pnp.idl index b3bcc221a49..f56b932120e 100644 --- a/sdk/include/reactos/idl/pnp.idl +++ b/sdk/include/reactos/idl/pnp.idl @@ -4,6 +4,9 @@ #include <ms-dtyp.idl> +typedef [context_handle] void *PNP_NOTIFY_HANDLE; +typedef PNP_NOTIFY_HANDLE *PPNP_NOTIFY_HANDLE; + const unsigned long PNP_MAX_STRING_LEN = 32767; const unsigned long PNP_MAX_DEVICE_ID_LEN = 200; const unsigned long PNP_MAX_GUID_STRING_LEN = 39; @@ -880,7 +883,7 @@ interface pnp [in, size_is(ulNotificationFilterSize)] BYTE *pNotificationFilter, [in] DWORD ulNotificationFilterSize, [in] DWORD ulFlags, - [out] DWORD *pulNotifyData, + [out] PPNP_NOTIFY_HANDLE pNotifyHandle, [in] DWORD ulProcessId, [in] DWORD *pulUnknown9); @@ -889,7 +892,7 @@ interface pnp __stdcall PNP_UnregisterNotification( [in] handle_t hBinding, - [in] DWORD ulNotifyData); + [in, out] PPNP_NOTIFY_HANDLE pNotifyHandle); cpp_quote("#if _WIN32_WINNT >= 0x0501")
2 years, 9 months
1
0
0
0
[reactos] 01/01: [FREELDR:NTLDR] Stub out x86 PAE support in preparation for PR #4272.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4a05ad7aa9372802fb8c…
commit d4a05ad7aa9372802fb8cee4fd8da32a5c707359 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Tue Jan 11 20:37:27 2022 +0400 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Mar 20 04:12:58 2022 +0100 [FREELDR:NTLDR] Stub out x86 PAE support in preparation for PR #4272. - Move boot options parsing early on in LoadWindowsCore(). - Add WinLdrIsPaeSupported(), move in it the PAE options parsing. The aim is to perform other tests to determine whether or not to enable PAE, and select an adequate kernel image. Co-authored-by: Vadim Galyant <vgal(a)rambler.ru> - Fix parsing of the NOEXECUTE options, taking their precedence into account. Most of these are also x86-specific. --- boot/freeldr/freeldr/ntldr/winldr.c | 219 +++++++++++++++++++++++------------- boot/freeldr/freeldr/ntldr/winldr.h | 3 + 2 files changed, 145 insertions(+), 77 deletions(-) diff --git a/boot/freeldr/freeldr/ntldr/winldr.c b/boot/freeldr/freeldr/ntldr/winldr.c index 5b06bef6e0f..c923330d6be 100644 --- a/boot/freeldr/freeldr/ntldr/winldr.c +++ b/boot/freeldr/freeldr/ntldr/winldr.c @@ -29,12 +29,12 @@ PLOADER_SYSTEM_BLOCK WinLdrSystemBlock; BOOLEAN VirtualBias = FALSE; BOOLEAN SosEnabled = FALSE; -BOOLEAN PaeEnabled = FALSE; -BOOLEAN PaeDisabled = FALSE; BOOLEAN SafeBoot = FALSE; BOOLEAN BootLogo = FALSE; -BOOLEAN NoexecuteDisabled = FALSE; -BOOLEAN NoexecuteEnabled = FALSE; +#ifdef _M_IX86 +BOOLEAN PaeModeOn = FALSE; +#endif +BOOLEAN NoExecuteEnabled = FALSE; // debug stuff VOID DumpMemoryAllocMap(VOID); @@ -534,6 +534,61 @@ LoadModule( return BaseAddress; } +#ifdef _M_IX86 +static +BOOLEAN +WinLdrIsPaeSupported( + _In_ USHORT OperatingSystemVersion, + _In_ PLOADER_PARAMETER_BLOCK LoaderBlock, + _In_ PCSTR BootOptions, + _In_ PCSTR HalFileName, + _Inout_updates_bytes_(KernelFileNameSize) _Always_(_Post_z_) + PSTR KernelFileName, + _In_ SIZE_T KernelFileNameSize) +{ + BOOLEAN PaeEnabled = FALSE; + BOOLEAN PaeDisabled = FALSE; + BOOLEAN Result; + + if ((OperatingSystemVersion > _WIN32_WINNT_NT4) && + NtLdrGetOption(BootOptions, "PAE")) + { + /* We found the PAE option */ + PaeEnabled = TRUE; + } + + Result = PaeEnabled; + + if ((OperatingSystemVersion > _WIN32_WINNT_WIN2K) && + NtLdrGetOption(BootOptions, "NOPAE")) + { + PaeDisabled = TRUE; + } + + if (SafeBoot) + PaeDisabled = TRUE; + + TRACE("PaeEnabled %X, PaeDisabled %X\n", PaeEnabled, PaeDisabled); + + if (PaeDisabled) + Result = FALSE; + + /* Enable PAE if DEP is enabled */ + if (NoExecuteEnabled) + Result = TRUE; + + // TODO: checks for CPU support, hotplug memory support ... other tests + // TODO: select kernel name ("ntkrnlpa.exe" or "ntoskrnl.exe"), or, + // if KernelFileName is a user-specified kernel file, check whether it + // has, if PAE needs to be enabled, the IMAGE_FILE_LARGE_ADDRESS_AWARE + // Characteristics bit set, and that the HAL image has a similar support. + + if (Result) UNIMPLEMENTED; + + return Result; +} +#endif /* _M_IX86 */ + static BOOLEAN LoadWindowsCore(IN USHORT OperatingSystemVersion, @@ -558,18 +613,87 @@ LoadWindowsCore(IN USHORT OperatingSystemVersion, RtlStringCbCopyA(DirPath, sizeof(DirPath), BootPath); RtlStringCbCatA(DirPath, sizeof(DirPath), "system32\\"); + /* Parse the boot options */ + TRACE("LoadWindowsCore: BootOptions '%s'\n", BootOptions); + +#ifdef _M_IX86 + if (NtLdrGetOption(BootOptions, "3GB")) + { + /* We found the 3GB option. */ + FIXME("LoadWindowsCore: 3GB - TRUE (not implemented)\n"); + VirtualBias = TRUE; + } + // TODO: "USERVA=" for XP/2k3 +#endif + + if ((OperatingSystemVersion > _WIN32_WINNT_NT4) && + (NtLdrGetOption(BootOptions, "SAFEBOOT") || + NtLdrGetOption(BootOptions, "SAFEBOOT:"))) + { + /* We found the SAFEBOOT option. */ + FIXME("LoadWindowsCore: SAFEBOOT - TRUE (not implemented)\n"); + SafeBoot = TRUE; + } + + if ((OperatingSystemVersion > _WIN32_WINNT_WIN2K) && + NtLdrGetOption(BootOptions, "BOOTLOGO")) + { + /* We found the BOOTLOGO option. */ + FIXME("LoadWindowsCore: BOOTLOGO - TRUE (not implemented)\n"); + BootLogo = TRUE; + } + + /* Check the (NO)EXECUTE options */ + if ((OperatingSystemVersion > _WIN32_WINNT_WIN2K) && + !LoaderBlock->SetupLdrBlock) + { + /* Disable NX by default on x86, otherwise enable it */ +#ifdef _M_IX86 + NoExecuteEnabled = FALSE; +#else + NoExecuteEnabled = TRUE; +#endif + +#ifdef _M_IX86 + /* Check the options in decreasing order of precedence */ + if (NtLdrGetOption(BootOptions, "NOEXECUTE=OPTIN") || + NtLdrGetOption(BootOptions, "NOEXECUTE=OPTOUT") || + NtLdrGetOption(BootOptions, "NOEXECUTE=ALWAYSON")) + { + NoExecuteEnabled = TRUE; + } + else if (NtLdrGetOption(BootOptions, "NOEXECUTE=ALWAYSOFF")) + NoExecuteEnabled = FALSE; + else +#else + /* Only the following two options really apply for x64 and other platforms */ +#endif + if (NtLdrGetOption(BootOptions, "NOEXECUTE")) + NoExecuteEnabled = TRUE; + else if (NtLdrGetOption(BootOptions, "EXECUTE")) + NoExecuteEnabled = FALSE; + +#ifdef _M_IX86 + /* Disable DEP in SafeBoot mode for x86 only */ + if (SafeBoot) + NoExecuteEnabled = FALSE; +#endif + } + TRACE("NoExecuteEnabled %X\n", NoExecuteEnabled); + /* - * Default HAL and KERNEL file names. + * Select the HAL and KERNEL file names. + * Check for any "/HAL=" or "/KERNEL=" override option. + * * See the following links to know how the file names are actually chosen: *
https://www.geoffchappell.com/notes/windows/boot/bcd/osloader/detecthal.htm
*
https://www.geoffchappell.com/notes/windows/boot/bcd/osloader/hal.htm
*
https://www.geoffchappell.com/notes/windows/boot/bcd/osloader/kernel.htm
*/ + /* Default HAL and KERNEL file names */ RtlStringCbCopyA(HalFileName , sizeof(HalFileName) , "hal.dll"); RtlStringCbCopyA(KernelFileName, sizeof(KernelFileName), "ntoskrnl.exe"); - /* Check for any "/HAL=" or "/KERNEL=" override option */ - Option = NtLdrGetOptionEx(BootOptions, "HAL=", &OptionLength); if (Option && (OptionLength > 4)) { @@ -588,6 +712,17 @@ LoadWindowsCore(IN USHORT OperatingSystemVersion, _strlwr(KernelFileName); } +#ifdef _M_IX86 + /* Check for PAE support and select the adequate kernel image */ + PaeModeOn = WinLdrIsPaeSupported(OperatingSystemVersion, + LoaderBlock, + BootOptions, + HalFileName, + KernelFileName, + sizeof(KernelFileName)); + if (PaeModeOn) FIXME("WinLdrIsPaeSupported: PaeModeOn\n"); +#endif + TRACE("HAL file = '%s' ; Kernel file = '%s'\n", HalFileName, KernelFileName); /* @@ -710,76 +845,6 @@ LoadWindowsCore(IN USHORT OperatingSystemVersion, } } - /* Parse the boot options */ - TRACE("LoadWindowsCore: BootOptions '%s'\n", BootOptions); - - if (NtLdrGetOption(BootOptions, "3GB")) - { - /* We found the 3GB option. */ - FIXME("LoadWindowsCore: 3GB - TRUE (not implemented)\n"); - VirtualBias = TRUE; - } - - if (OperatingSystemVersion > _WIN32_WINNT_NT4) - { - if (NtLdrGetOption(BootOptions, "SAFEBOOT")) - { - /* We found the SAFEBOOT option. */ - FIXME("LoadWindowsCore: SAFEBOOT - TRUE (not implemented)\n"); - SafeBoot = TRUE; - } - if (NtLdrGetOption(BootOptions, "PAE")) - { - /* We found the PAE option. */ - FIXME("LoadWindowsCore: PAE - TRUE (not implemented)\n"); - PaeEnabled = TRUE; - } - } - - if (OperatingSystemVersion > _WIN32_WINNT_WIN2K) - { - if (NtLdrGetOption(BootOptions, "NOPAE")) - { - /* We found the NOPAE option. */ - FIXME("LoadWindowsCore: NOPAE - TRUE (not implemented)\n"); - PaeDisabled = TRUE; - } - if (NtLdrGetOption(BootOptions, "BOOTLOGO")) - { - /* We found the BOOTLOGO option. */ - FIXME("LoadWindowsCore: BOOTLOGO - TRUE (not implemented)\n"); - BootLogo = TRUE; - } - - if (!LoaderBlock->SetupLdrBlock) - { - if (NtLdrGetOption(BootOptions, "EXECUTE")) - { - /* We found the EXECUTE option. */ - FIXME("LoadWindowsCore: EXECUTE - TRUE (not implemented)\n"); - NoexecuteDisabled = TRUE; - } - if (NtLdrGetOption(BootOptions, "NOEXECUTE=ALWAYSOFF")) - { - /* We found the NOEXECUTE=ALWAYSOFF option. */ - FIXME("LoadWindowsCore: NOEXECUTE=ALWAYSOFF - TRUE (not implemented)\n"); - NoexecuteDisabled = TRUE; - } - if (NtLdrGetOption(BootOptions, "NOEXECUTE")) - { - /* We found the NOEXECUTE option. */ - FIXME("LoadWindowsCore: NOEXECUTE - TRUE (not implemented)\n"); - NoexecuteEnabled = TRUE; - } - } - } - - if (SafeBoot) - { - PaeDisabled = TRUE; - NoexecuteDisabled = TRUE; - } - /* Load all referenced DLLs for Kernel, HAL and Kernel Debugger Transport DLL */ Success = PeLdrScanImportDescriptorTable(&LoaderBlock->LoadOrderListHead, DirPath, *KernelDTE); if (!Success) diff --git a/boot/freeldr/freeldr/ntldr/winldr.h b/boot/freeldr/freeldr/ntldr/winldr.h index 38598e29f85..ee7c1fede7d 100644 --- a/boot/freeldr/freeldr/ntldr/winldr.h +++ b/boot/freeldr/freeldr/ntldr/winldr.h @@ -74,6 +74,9 @@ VOID ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start); // winldr.c extern BOOLEAN SosEnabled; +#ifdef _M_IX86 +extern BOOLEAN PaeModeOn; +#endif FORCEINLINE VOID
2 years, 9 months
1
0
0
0
[reactos] 03/03: [WIN32SS:DISPLAY] Fix some return values (use correct types) in display drivers.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=52275a92bdf3b0fb3842e…
commit 52275a92bdf3b0fb3842e9c8edcd9f8503673319 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Jan 6 20:35:11 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Mar 19 17:51:44 2022 +0100 [WIN32SS:DISPLAY] Fix some return values (use correct types) in display drivers. See for example, in DrvEnableSurface(), etc. TODO: framebufacc's comments need to be "translated" into actual English... --- win32ss/drivers/displays/framebuf/ddenable.c | 6 ++--- win32ss/drivers/displays/framebuf/screen.c | 2 +- win32ss/drivers/displays/framebuf/surface.c | 10 +++---- win32ss/drivers/displays/framebuf_new/enable.c | 32 +++++++++++----------- win32ss/drivers/displays/framebuf_new/palette.c | 10 +++---- win32ss/drivers/displays/framebuf_new/pointer.c | 8 +++--- win32ss/drivers/displays/framebuf_new/screen.c | 8 +++--- win32ss/drivers/displays/framebufacc/ddenable.c | 6 ++--- win32ss/drivers/displays/framebufacc/pointer.c | 4 +-- win32ss/drivers/displays/framebufacc/screen.c | 2 +- win32ss/drivers/displays/framebufacc/surface.c | 8 +++--- win32ss/drivers/displays/vga/main/enable.c | 8 +++--- win32ss/drivers/displays/vga/objects/paint.c | 6 ++--- win32ss/drivers/displays/vga/objects/screen.c | 4 +-- win32ss/drivers/displays/vga_new/enable.c | 36 ++++++++++++------------- win32ss/drivers/displays/vga_new/palette.c | 10 +++---- win32ss/drivers/displays/vga_new/screen.c | 8 +++--- 17 files changed, 84 insertions(+), 84 deletions(-) diff --git a/win32ss/drivers/displays/framebuf/ddenable.c b/win32ss/drivers/displays/framebuf/ddenable.c index e2585fc2e2b..a1dcfdbd396 100644 --- a/win32ss/drivers/displays/framebuf/ddenable.c +++ b/win32ss/drivers/displays/framebuf/ddenable.c @@ -88,7 +88,7 @@ DrvEnableDirectDraw( break; } - if (pCallBacks !=NULL) + if (pCallBacks != NULL) { memset(pCallBacks,0,sizeof(DD_CALLBACKS)); @@ -101,7 +101,7 @@ DrvEnableDirectDraw( pCallBacks->dwFlags = DDHAL_CB32_CANCREATESURFACE | DDHAL_CB32_CREATESURFACE; } - if (pSurfaceCallBacks !=NULL) + if (pSurfaceCallBacks != NULL) { memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS)); @@ -114,7 +114,7 @@ DrvEnableDirectDraw( // pSurfaceCallBacks->dwFlags = DDHAL_SURFCB32_DESTROYSURFACE | DDHAL_SURFCB32_LOCK | DDHAL_SURFCB32_BLT ; } - if (pPaletteCallBacks !=NULL) + if (pPaletteCallBacks != NULL) { memset(pPaletteCallBacks,0,sizeof(DD_PALETTECALLBACKS)); /* FILL pPaletteCallBacks with hal stuff */ diff --git a/win32ss/drivers/displays/framebuf/screen.c b/win32ss/drivers/displays/framebuf/screen.c index 7ec7ecff138..b39254b714e 100644 --- a/win32ss/drivers/displays/framebuf/screen.c +++ b/win32ss/drivers/displays/framebuf/screen.c @@ -79,7 +79,7 @@ GetAvailableModes( &ulTemp)) { EngFreeMem(*ModeInfo); - *ModeInfo = (PVIDEO_MODE_INFORMATION)NULL; + *ModeInfo = NULL; return 0; } diff --git a/win32ss/drivers/displays/framebuf/surface.c b/win32ss/drivers/displays/framebuf/surface.c index b0b74da295c..b0a9b4fabb1 100644 --- a/win32ss/drivers/displays/framebuf/surface.c +++ b/win32ss/drivers/displays/framebuf/surface.c @@ -50,7 +50,7 @@ DrvEnableSurface( &(ppdev->ModeIndex), sizeof(ULONG), NULL, 0, &ulTemp)) { - return FALSE; + return NULL; } /* @@ -63,7 +63,7 @@ DrvEnableSurface( &VideoMemoryInfo, sizeof(VIDEO_MEMORY_INFORMATION), &ulTemp)) { - return FALSE; + return NULL; } ppdev->ScreenPtr = VideoMemoryInfo.FrameBufferBase; @@ -88,7 +88,7 @@ DrvEnableSurface( break; default: - return FALSE; + return NULL; } ppdev->iDitherFormat = BitmapType; @@ -101,7 +101,7 @@ DrvEnableSurface( ppdev->ScreenPtr); if (hSurface == NULL) { - return FALSE; + return NULL; } /* @@ -111,7 +111,7 @@ DrvEnableSurface( if (!EngAssociateSurface(hSurface, ppdev->hDevEng, 0)) { EngDeleteSurface(hSurface); - return FALSE; + return NULL; } ppdev->hSurfEng = hSurface; diff --git a/win32ss/drivers/displays/framebuf_new/enable.c b/win32ss/drivers/displays/framebuf_new/enable.c index f22ef24f760..5b668f67288 100644 --- a/win32ss/drivers/displays/framebuf_new/enable.c +++ b/win32ss/drivers/displays/framebuf_new/enable.c @@ -70,7 +70,7 @@ PDRVENABLEDATA pded) pded->iDriverVersion = DDI_DRIVER_VERSION_NT4; // eVb: 1.2 [END] - return(TRUE); + return TRUE; } /******************************Public*Routine******************************\ @@ -97,7 +97,7 @@ HANDLE hDriver) // Handle to base driver { GDIINFO GdiInfo; DEVINFO DevInfo; - PPDEV ppdev = (PPDEV) NULL; + PPDEV ppdev = NULL; UNREFERENCED_PARAMETER(pwszLogAddress); UNREFERENCED_PARAMETER(pwszDeviceName); @@ -106,10 +106,10 @@ HANDLE hDriver) // Handle to base driver ppdev = (PPDEV) EngAllocMem(0, sizeof(PDEV), ALLOC_TAG); - if (ppdev == (PPDEV) NULL) + if (ppdev == NULL) { RIP("DISP DrvEnablePDEV failed EngAllocMem\n"); - return((DHPDEV) 0); + return NULL; } memset(ppdev, 0, sizeof(PDEV)); @@ -151,12 +151,12 @@ HANDLE hDriver) // Handle to base driver memcpy(pGdiInfo, &GdiInfo, min(cjGdiInfo, sizeof(GDIINFO))); - return((DHPDEV) ppdev); + return (DHPDEV)ppdev; // Error case for failure. error_free: EngFreeMem(ppdev); - return((DHPDEV) 0); + return NULL; } /******************************Public*Routine******************************\ @@ -213,7 +213,7 @@ DHPDEV dhpdev) if (!bInitSURF(ppdev, TRUE)) { RIP("DISP DrvEnableSurface failed bInitSURF\n"); - return(FALSE); + return NULL; } sizl.cx = ppdev->cxScreen; @@ -223,7 +223,7 @@ DHPDEV dhpdev) { if (!bInit256ColorPalette(ppdev)) { RIP("DISP DrvEnableSurface failed to init the 8bpp palette\n"); - return(FALSE); + return NULL; } ulBitmapType = BMF_8BPP; flHooks = HOOKS_BMF8BPP; @@ -251,10 +251,10 @@ DHPDEV dhpdev) sizl, ulBitmapType); - if (hsurf == (HSURF) 0) + if (hsurf == NULL) { RIP("DISP DrvEnableSurface failed EngCreateDeviceSurface\n"); - return(FALSE); + return NULL; } // eVb: 1.4 [END] @@ -269,12 +269,12 @@ DHPDEV dhpdev) NULL)) { RIP("DISP DrvEnableSurface failed EngModifySurface\n"); - return(FALSE); + return NULL; } // eVb: 1.5 [END] ppdev->hsurfEng = hsurf; - return(hsurf); + return hsurf; } /******************************Public*Routine******************************\ @@ -289,7 +289,7 @@ DHPDEV dhpdev) { EngDeleteSurface(((PPDEV) dhpdev)->hsurfEng); vDisableSURF((PPDEV) dhpdev); - ((PPDEV) dhpdev)->hsurfEng = (HSURF) 0; + ((PPDEV) dhpdev)->hsurfEng = NULL; } /******************************Public*Routine******************************\ @@ -318,7 +318,7 @@ BOOL bEnable) if (!bInitSURF(ppdev, FALSE)) { DISPDBG((0, "DISP DrvAssertMode failed bInitSURF\n")); - return (FALSE); + return FALSE; } if (pjScreen != ppdev->pjScreen) { @@ -333,11 +333,11 @@ BOOL bEnable) NULL)) { DISPDBG((0, "DISP DrvAssertMode failed EngModifySurface\n")); - return (FALSE); + return FALSE; } } // eVb: 1.6 [END] - return (TRUE); + return TRUE; } else { diff --git a/win32ss/drivers/displays/framebuf_new/palette.c b/win32ss/drivers/displays/framebuf_new/palette.c index fbcafef7971..dc16a1576eb 100644 --- a/win32ss/drivers/displays/framebuf_new/palette.c +++ b/win32ss/drivers/displays/framebuf_new/palette.c @@ -69,10 +69,10 @@ VOID NTAPI vDisablePalette(PPDEV ppdev) if (ppdev->hpalDefault) { EngDeletePalette(ppdev->hpalDefault); - ppdev->hpalDefault = (HPALETTE) 0; + ppdev->hpalDefault = NULL; } - if (ppdev->pPal != (PPALETTEENTRY)NULL) + if (ppdev->pPal != NULL) EngFreeMem((PVOID)ppdev->pPal); } @@ -151,7 +151,7 @@ BOOL NTAPI bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo) (PULONG) ppdev->pPal, 0,0,0); - if (ppdev->hpalDefault == (HPALETTE) 0) + if (ppdev->hpalDefault == NULL) { RIP("DISP bInitDefaultPalette failed EngCreatePalette\n"); EngFreeMem(ppdev->pPal); @@ -168,12 +168,12 @@ BOOL NTAPI bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo) ppdev->hpalDefault = pDevInfo->hpalDefault = EngCreatePalette(PAL_BITFIELDS, - 0,(PULONG) NULL, + 0, NULL, ppdev->flRed, ppdev->flGreen, ppdev->flBlue); - if (ppdev->hpalDefault == (HPALETTE) 0) + if (ppdev->hpalDefault == NULL) { RIP("DISP bInitDefaultPalette failed EngCreatePalette\n"); return(FALSE); diff --git a/win32ss/drivers/displays/framebuf_new/pointer.c b/win32ss/drivers/displays/framebuf_new/pointer.c index a0847ad91d3..862fc8e6ed2 100644 --- a/win32ss/drivers/displays/framebuf_new/pointer.c +++ b/win32ss/drivers/displays/framebuf_new/pointer.c @@ -130,7 +130,7 @@ ULONG NTAPI DrvSetPointerShape // to exclude out pointer before drawing to the pixels in prcl. UNREFERENCED_PARAMETER(prcl); - if (ppdev->pPointerAttributes == (PVIDEO_POINTER_ATTRIBUTES) NULL) + if (ppdev->pPointerAttributes == NULL) { // Mini-port has no hardware Pointer support. return(SPS_ERROR); @@ -138,7 +138,7 @@ ULONG NTAPI DrvSetPointerShape // See if we are being asked to hide the pointer - if (psoMask == (SURFOBJ *) NULL) + if (psoMask == NULL) { if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, @@ -215,7 +215,7 @@ FLONG fl) PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = ppdev->pPointerAttributes; DWORD returnedDataLength; - if (psoColor != (SURFOBJ *) NULL) + if (psoColor != NULL) { if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) && bCopyColorPointer(ppdev, psoMask, psoColor, pxlo)) @@ -401,7 +401,7 @@ BOOL NTAPI bInitPointer(PPDEV ppdev, DEVINFO *pdevinfo) { DWORD returnedDataLength; - ppdev->pPointerAttributes = (PVIDEO_POINTER_ATTRIBUTES) NULL; + ppdev->pPointerAttributes = NULL; ppdev->cjPointerAttributes = 0; // initialized in screen.c // diff --git a/win32ss/drivers/displays/framebuf_new/screen.c b/win32ss/drivers/displays/framebuf_new/screen.c index bcfe8ca4263..66f25faf649 100644 --- a/win32ss/drivers/displays/framebuf_new/screen.c +++ b/win32ss/drivers/displays/framebuf_new/screen.c @@ -526,7 +526,7 @@ DWORD *cbModeSize) &ulTemp)) { DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n")); - return(0); + return 0; } *cbModeSize = modes.ModeInformationLength; @@ -539,7 +539,7 @@ DWORD *cbModeSize) EngAllocMem(0, modes.NumModes * modes.ModeInformationLength, ALLOC_TAG); - if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL) + if (*modeInformation == NULL) { DISPDBG((0, "getAvailableModes failed EngAllocMem\n")); @@ -562,9 +562,9 @@ DWORD *cbModeSize) DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n")); EngFreeMem(*modeInformation); - *modeInformation = (PVIDEO_MODE_INFORMATION) NULL; + *modeInformation = NULL; - return(0); + return 0; } // diff --git a/win32ss/drivers/displays/framebufacc/ddenable.c b/win32ss/drivers/displays/framebufacc/ddenable.c index 9b352a2afe3..335fd536c0f 100644 --- a/win32ss/drivers/displays/framebufacc/ddenable.c +++ b/win32ss/drivers/displays/framebufacc/ddenable.c @@ -88,7 +88,7 @@ DrvEnableDirectDraw( break; } - if (pCallBacks !=NULL) + if (pCallBacks != NULL) { memset(pCallBacks,0,sizeof(DD_CALLBACKS)); @@ -101,7 +101,7 @@ DrvEnableDirectDraw( pCallBacks->dwFlags = DDHAL_CB32_CANCREATESURFACE | DDHAL_CB32_CREATESURFACE; } - if (pSurfaceCallBacks !=NULL) + if (pSurfaceCallBacks != NULL) { memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS)); @@ -114,7 +114,7 @@ DrvEnableDirectDraw( // pSurfaceCallBacks->dwFlags = DDHAL_SURFCB32_DESTROYSURFACE | DDHAL_SURFCB32_LOCK | DDHAL_SURFCB32_BLT ; } - if (pPaletteCallBacks !=NULL) + if (pPaletteCallBacks != NULL) { memset(pPaletteCallBacks,0,sizeof(DD_PALETTECALLBACKS)); /* FILL pPaletteCallBacks with hal stuff */ diff --git a/win32ss/drivers/displays/framebufacc/pointer.c b/win32ss/drivers/displays/framebufacc/pointer.c index d4afcf1aed1..92a3c65de47 100644 --- a/win32ss/drivers/displays/framebufacc/pointer.c +++ b/win32ss/drivers/displays/framebufacc/pointer.c @@ -102,7 +102,7 @@ DrvSetPointerShape( } /* check see if the apps ask to hide the mouse or not */ - if (psoMask == (SURFOBJ *) NULL) + if (psoMask == NULL) { if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength)) { @@ -119,7 +119,7 @@ DrvSetPointerShape( /* Set the hw mouse shape */ - if (psoColor != (SURFOBJ *) NULL) + if (psoColor != NULL) { /* We got a color mouse pointer */ if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) && diff --git a/win32ss/drivers/displays/framebufacc/screen.c b/win32ss/drivers/displays/framebufacc/screen.c index 698350d9b08..c6fd6bc872d 100644 --- a/win32ss/drivers/displays/framebufacc/screen.c +++ b/win32ss/drivers/displays/framebufacc/screen.c @@ -70,7 +70,7 @@ GetAvailableModes( &ulTemp)) { EngFreeMem(*ModeInfo); - *ModeInfo = (PVIDEO_MODE_INFORMATION)NULL; + *ModeInfo = NULL; return 0; } diff --git a/win32ss/drivers/displays/framebufacc/surface.c b/win32ss/drivers/displays/framebufacc/surface.c index 2a3182c2a49..920ab3f1ffe 100644 --- a/win32ss/drivers/displays/framebufacc/surface.c +++ b/win32ss/drivers/displays/framebufacc/surface.c @@ -152,7 +152,7 @@ DrvEnableSurface( /* Setup surface and force the mapping */ if (!InitSurface(ppdev, TRUE)) { - return FALSE; + return NULL; } /* Rest the desktop vitual position */ @@ -180,7 +180,7 @@ DrvEnableSurface( break; default: - return FALSE; + return NULL; } ppdev->iDitherFormat = BitmapType; @@ -193,7 +193,7 @@ DrvEnableSurface( ppdev->ScreenPtr); if (hSurface == NULL) { - return FALSE; + return NULL; } /* Which api we hooking to */ @@ -207,7 +207,7 @@ DrvEnableSurface( if (!EngAssociateSurface(hSurface, ppdev->hDevEng, ppdev->dwHooks)) { EngDeleteSurface(hSurface); - return FALSE; + return NULL; } ppdev->hSurfEng = hSurface; diff --git a/win32ss/drivers/displays/vga/main/enable.c b/win32ss/drivers/displays/vga/main/enable.c index f7223c22a3a..8a644b2280c 100644 --- a/win32ss/drivers/displays/vga/main/enable.c +++ b/win32ss/drivers/displays/vga/main/enable.c @@ -375,7 +375,7 @@ DrvDisableSurface(IN DHPDEV PDev) /* free any pending saved screen bit blocks */ #if 0 pSSB = pdsurf->ssbList; - while (pSSB != (PSAVED_SCREEN_BITS) NULL) + while (pSSB != NULL) { /* Point to the next saved screen bits block */ pSSBNext = (PSAVED_SCREEN_BITS) pSSB->pvNextSSB; @@ -450,7 +450,7 @@ DrvEnableSurface(IN DHPDEV PDev) /* dhsurf is of type DEVSURF, which is the drivers specialized surface type */ dhsurf = (DHSURF)EngAllocMem(0, sizeof(DEVSURF), ALLOC_TAG); - if (dhsurf == (DHSURF) 0) + if (dhsurf == NULL) goto error_done; pdsurf = (PDEVSURF) dhsurf; @@ -485,7 +485,7 @@ DrvEnableSurface(IN DHPDEV PDev) } BANKING CODE UNIMPLEMENTED */ if ((hsurf = EngCreateDeviceSurface(dhsurf, ppdev->sizeSurf, BMF_4BPP)) == - (HSURF)0) + NULL) { /* Call to EngCreateDeviceSurface failed */ DPRINT("EngCreateDeviceSurface call failed\n"); @@ -513,7 +513,7 @@ error_clean: EngFreeMem(dhsurf); error_done: - return (HSURF)0; + return NULL; } diff --git a/win32ss/drivers/displays/vga/objects/paint.c b/win32ss/drivers/displays/vga/objects/paint.c index a0204565774..6325ae92a03 100644 --- a/win32ss/drivers/displays/vga/objects/paint.c +++ b/win32ss/drivers/displays/vga/objects/paint.c @@ -245,8 +245,8 @@ doBitBlt: // If VGADDIPaint can't do it, VGADDIBitBlt can.. or it might just loop back // here and we have a nice infinite loop - return( VGADDIBitBlt(Surface, (SURFOBJ *)NULL, (SURFOBJ *)NULL, ClipRegion, - (XLATEOBJ *)NULL, &ClipRegion->rclBounds, - NULL, (POINTL *)NULL, Brush, BrushOrigin, + return( VGADDIBitBlt(Surface, NULL, NULL, ClipRegion, + NULL, &ClipRegion->rclBounds, + NULL, NULL, Brush, BrushOrigin, NULL) ); UNIMPLEMENTED */ } diff --git a/win32ss/drivers/displays/vga/objects/screen.c b/win32ss/drivers/displays/vga/objects/screen.c index 51f7c3b38f0..8c11ef0cebe 100644 --- a/win32ss/drivers/displays/vga/objects/screen.c +++ b/win32ss/drivers/displays/vga/objects/screen.c @@ -64,7 +64,7 @@ DWORD getAvailableModes( EngAllocMem(0, modes.NumModes * modes.ModeInformationLength, ALLOC_TAG); - if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL) + if (*modeInformation == NULL) { /* couldn't allocate buffer */ return 0; @@ -81,7 +81,7 @@ DWORD getAvailableModes( { /* failed to query modes */ EngFreeMem(*modeInformation); - *modeInformation = (PVIDEO_MODE_INFORMATION) NULL; + *modeInformation = NULL; return 0; } diff --git a/win32ss/drivers/displays/vga_new/enable.c b/win32ss/drivers/displays/vga_new/enable.c index 08a8d147658..bb941994a64 100644 --- a/win32ss/drivers/displays/vga_new/enable.c +++ b/win32ss/drivers/displays/vga_new/enable.c @@ -76,7 +76,7 @@ PDRVENABLEDATA pded) pded->iDriverVersion = DDI_DRIVER_VERSION_NT4; // eVb: 1.2 [END] - return(TRUE); + return TRUE; } /******************************Public*Routine******************************\ @@ -103,7 +103,7 @@ HANDLE hDriver) // Handle to base driver { GDIINFO GdiInfo; DEVINFO DevInfo; - PPDEV ppdev = (PPDEV) NULL; + PPDEV ppdev = NULL; UNREFERENCED_PARAMETER(pwszLogAddress); UNREFERENCED_PARAMETER(pwszDeviceName); @@ -112,10 +112,10 @@ HANDLE hDriver) // Handle to base driver ppdev = (PPDEV) EngAllocMem(0, sizeof(PDEV), ALLOC_TAG); - if (ppdev == (PPDEV) NULL) + if (ppdev == NULL) { RIP("DISP DrvEnablePDEV failed EngAllocMem\n"); - return((DHPDEV) 0); + return NULL; } memset(ppdev, 0, sizeof(PDEV)); @@ -161,12 +161,12 @@ HANDLE hDriver) // Handle to base driver memcpy(pGdiInfo, &GdiInfo, min(cjGdiInfo, sizeof(GDIINFO))); - return((DHPDEV) ppdev); + return (DHPDEV)ppdev; // Error case for failure. error_free: EngFreeMem(ppdev); - return((DHPDEV) 0); + return NULL; } /******************************Public*Routine******************************\ @@ -226,7 +226,7 @@ DHPDEV dhpdev) if (!bInitSURF(ppdev, TRUE)) { RIP("DISP DrvEnableSurface failed bInitSURF\n"); - return(FALSE); + return NULL; } sizl.cx = ppdev->cxScreen; @@ -238,7 +238,7 @@ DHPDEV dhpdev) { if (!bInit256ColorPalette(ppdev)) { RIP("DISP DrvEnableSurface failed to init the 8bpp palette\n"); - return(FALSE); + return NULL; } ulBitmapType = BMF_8BPP; flHooks = HOOKS_BMF8BPP; @@ -266,14 +266,14 @@ DHPDEV dhpdev) #endif // eVb: 1.3 [END] // eVb: 1.4 [DDK Change] - Use EngCreateDeviceSurface instead of EngCreateBitmap - hsurf = (HSURF)EngCreateDeviceSurface((DHSURF)ppdev, + hsurf = (HSURF)EngCreateDeviceSurface((DHSURF)ppdev, sizl, ulBitmapType); - if (hsurf == (HSURF) 0) + if (hsurf == NULL) { RIP("DISP DrvEnableSurface failed EngCreateDeviceSurface\n"); - return(FALSE); + return NULL; } // eVb: 1.4 [END] @@ -288,16 +288,16 @@ DHPDEV dhpdev) NULL)) { RIP("DISP DrvEnableSurface failed EngModifySurface\n"); - return(FALSE); + return NULL; } // eVb: 1.5 [END] ppdev->hsurfEng = hsurf; // eVb: 1.4 [VGARISC Change] - Allocate 4BPP DIB that will store GDI drawing hSurfBitmap = (HSURF)EngCreateBitmap(sizl, 0, ulBitmapType, 0, NULL); - if (hSurfBitmap == (HSURF) 0) + if (hSurfBitmap == NULL) { RIP("DISP DrvEnableSurface failed EngCreateBitmap\n"); - return(FALSE); + return NULL; } if ( !EngModifySurface(hSurfBitmap, @@ -310,17 +310,17 @@ DHPDEV dhpdev) NULL)) { RIP("DISP DrvEnableSurface failed second EngModifySurface\n"); - return(FALSE); + return NULL; } ppdev->pso = EngLockSurface(hSurfBitmap); if (ppdev->pso == NULL) { RIP("DISP DrvEnableSurface failed EngLockSurface\n"); - return(FALSE); + return NULL; } // eVb: 1.4 [END] - return(hsurf); + return hsurf; } /******************************Public*Routine******************************\ @@ -335,7 +335,7 @@ DHPDEV dhpdev) { EngDeleteSurface(((PPDEV) dhpdev)->hsurfEng); vDisableSURF((PPDEV) dhpdev); - ((PPDEV) dhpdev)->hsurfEng = (HSURF) 0; + ((PPDEV) dhpdev)->hsurfEng = NULL; } /******************************Public*Routine******************************\ diff --git a/win32ss/drivers/displays/vga_new/palette.c b/win32ss/drivers/displays/vga_new/palette.c index 27499a6d4a8..c2300417fca 100644 --- a/win32ss/drivers/displays/vga_new/palette.c +++ b/win32ss/drivers/displays/vga_new/palette.c @@ -86,12 +86,12 @@ VOID vDisablePalette(PPDEV ppdev) if (ppdev->hpalDefault) { EngDeletePalette(ppdev->hpalDefault); - ppdev->hpalDefault = (HPALETTE) 0; + ppdev->hpalDefault = NULL; } // eVb: 4.2 [VGARISC Change] - VGA Palette is static, no need to free #if 0 - if (ppdev->pPal != (PPALETTEENTRY)NULL) + if (ppdev->pPal != NULL) EngFreeMem((PVOID)ppdev->pPal); #endif // eVb: 4.2 [END] @@ -178,7 +178,7 @@ BOOL bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo) // eVb: 4.4 [END] 0,0,0); - if (ppdev->hpalDefault == (HPALETTE) 0) + if (ppdev->hpalDefault == NULL) { RIP("DISP bInitDefaultPalette failed EngCreatePalette\n"); // eVb: 4.5 [VGARISC Change] - VGA Palette is static, no need to free @@ -199,12 +199,12 @@ BOOL bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo) ppdev->hpalDefault = pDevInfo->hpalDefault = EngCreatePalette(PAL_BITFIELDS, - 0,(PULONG) NULL, + 0, NULL, ppdev->flRed, ppdev->flGreen, ppdev->flBlue); - if (ppdev->hpalDefault == (HPALETTE) 0) + if (ppdev->hpalDefault == NULL) { RIP("DISP bInitDefaultPalette failed EngCreatePalette\n"); return(FALSE); diff --git a/win32ss/drivers/displays/vga_new/screen.c b/win32ss/drivers/displays/vga_new/screen.c index e69317ac427..da66a5cde63 100644 --- a/win32ss/drivers/displays/vga_new/screen.c +++ b/win32ss/drivers/displays/vga_new/screen.c @@ -670,7 +670,7 @@ DWORD *cbModeSize) &ulTemp)) { DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n")); - return(0); + return 0; } *cbModeSize = modes.ModeInformationLength; @@ -683,7 +683,7 @@ DWORD *cbModeSize) EngAllocMem(0, modes.NumModes * modes.ModeInformationLength, ALLOC_TAG); - if (*modeInformation == (PVIDEO_MODE_INFORMATION) NULL) + if (*modeInformation == NULL) { DISPDBG((0, "getAvailableModes failed EngAllocMem\n")); @@ -706,9 +706,9 @@ DWORD *cbModeSize) DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n")); EngFreeMem(*modeInformation); - *modeInformation = (PVIDEO_MODE_INFORMATION) NULL; + *modeInformation = NULL; - return(0); + return 0; } //
2 years, 9 months
1
0
0
0
[reactos] 02/03: [WIN32SS] Use the DCFLAGS and DCTYPE flags defined in ntgdi/dc.h instead of the old ones in include/ntgdihdl.h
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5e93daa9ce4a78fa2dac9…
commit 5e93daa9ce4a78fa2dac9df6510496cd286572e7 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Jan 10 01:44:09 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Mar 19 17:26:09 2022 +0100 [WIN32SS] Use the DCFLAGS and DCTYPE flags defined in ntgdi/dc.h instead of the old ones in include/ntgdihdl.h The names of these new flags match the documented ones at
https://reactos.org/wiki/Techwiki:Win32k/DC
https://books.google.hr/books?id=-O92IIF1Bj4C&pg=PA197&lpg=PA197
and the gdikdx debug extension. --- win32ss/gdi/ntgdi/bitblt.c | 14 +++++++------- win32ss/gdi/ntgdi/bitmaps.c | 2 +- win32ss/gdi/ntgdi/cliprgn.c | 20 ++++++++++---------- win32ss/gdi/ntgdi/dc.h | 10 +++++----- win32ss/gdi/ntgdi/dclife.c | 24 ++++++++++++------------ win32ss/gdi/ntgdi/dcobjs.c | 6 +++--- win32ss/gdi/ntgdi/dcstate.c | 4 ++-- win32ss/gdi/ntgdi/dcutil.c | 10 +++++----- win32ss/gdi/ntgdi/dibobj.c | 4 ++-- win32ss/gdi/ntgdi/palette.c | 2 +- win32ss/include/ntgdihdl.h | 22 ---------------------- win32ss/reactx/ntddraw/dxeng.c | 8 ++++---- win32ss/user/ntuser/desktop.c | 2 +- win32ss/user/ntuser/windc.c | 2 +- 14 files changed, 54 insertions(+), 76 deletions(-) diff --git a/win32ss/gdi/ntgdi/bitblt.c b/win32ss/gdi/ntgdi/bitblt.c index 17172732a8c..2e3eaeef0b2 100644 --- a/win32ss/gdi/ntgdi/bitblt.c +++ b/win32ss/gdi/ntgdi/bitblt.c @@ -61,7 +61,7 @@ NtGdiAlphaBlend( DCDest = apObj[0]; DCSrc = apObj[1]; - if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) + if (DCDest->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); @@ -239,7 +239,7 @@ NtGdiTransparentBlt( DCDest = apObj[0]; DCSrc = apObj[1]; - if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) + if (DCDest->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); @@ -401,7 +401,7 @@ NtGdiMaskBlt( return FALSE; } - if (DCDest->dctype == DC_TYPE_INFO) + if (DCDest->dctype == DCTYPE_INFO) { if(DCSrc) DC_UnlockDc(DCSrc); DC_UnlockDc(DCDest); @@ -413,7 +413,7 @@ NtGdiMaskBlt( if (UsesSource) { ASSERT(DCSrc); - if (DCSrc->dctype == DC_TYPE_INFO) + if (DCSrc->dctype == DCTYPE_INFO) { DC_UnlockDc(DCDest); DC_UnlockDc(DCSrc); @@ -624,7 +624,7 @@ GreStretchBltMask( DCSrc = apObj[1]; DCMask = apObj[2]; - if (DCDest->dctype == DC_TYPE_INFO) + if (DCDest->dctype == DCTYPE_INFO) { if(DCSrc) GDIOBJ_vUnlockObject(&DCSrc->BaseObject); if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject); @@ -635,7 +635,7 @@ GreStretchBltMask( if (UsesSource) { - if (DCSrc->dctype == DC_TYPE_INFO) + if (DCSrc->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCDest->BaseObject); GDIOBJ_vUnlockObject(&DCSrc->BaseObject); @@ -941,7 +941,7 @@ IntGdiPolyPatBlt( return FALSE; } - if (pdc->dctype == DC_TYPE_INFO) + if (pdc->dctype == DCTYPE_INFO) { DC_UnlockDc(pdc); /* Yes, Windows really returns TRUE in this case */ diff --git a/win32ss/gdi/ntgdi/bitmaps.c b/win32ss/gdi/ntgdi/bitmaps.c index dbde5fd42c2..c2f38c55f40 100644 --- a/win32ss/gdi/ntgdi/bitmaps.c +++ b/win32ss/gdi/ntgdi/bitmaps.c @@ -286,7 +286,7 @@ IntCreateCompatibleBitmap( return NtGdiGetStockObject(DEFAULT_BITMAP); } - if (Dc->dctype != DC_TYPE_MEMORY) + if (Dc->dctype != DCTYPE_MEMORY) { PSURFACE psurf; diff --git a/win32ss/gdi/ntgdi/cliprgn.c b/win32ss/gdi/ntgdi/cliprgn.c index 3084416a331..35cb97ca6b7 100644 --- a/win32ss/gdi/ntgdi/cliprgn.c +++ b/win32ss/gdi/ntgdi/cliprgn.c @@ -17,7 +17,7 @@ IntGdiReleaseRaoRgn(PDC pDC) { INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - pDC->fs |= DC_FLAG_DIRTY_RAO; + pDC->fs |= DC_DIRTY_RAO; Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; // Need to validate Vis. } @@ -75,7 +75,7 @@ GdiSelectVisRgn( return; } - dc->fs |= DC_FLAG_DIRTY_RAO; + dc->fs |= DC_DIRTY_RAO; ASSERT(dc->prgnVis != NULL); ASSERT(prgn != NULL); @@ -234,7 +234,7 @@ IntGdiExtSelectClipRect( { Ret = IntSelectClipRgn( dc, NULL, RGN_COPY); - if (dc->fs & DC_FLAG_DIRTY_RAO) + if (dc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(dc); if (Ret) // Copy? Return Vis complexity. @@ -260,7 +260,7 @@ IntGdiExtSelectClipRect( Ret = IntSelectClipRgn( dc, prgn, fnMode); - if (dc->fs & DC_FLAG_DIRTY_RAO) + if (dc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(dc); if (Ret) // In this case NtGdiExtSelectClipRgn tests pass. @@ -295,7 +295,7 @@ IntGdiExtSelectClipRgn( { DPRINT("IntGdiExtSelectClipRgn A %d\n",Ret); // Update the Rao, it must be this way for now. - if (dc->fs & DC_FLAG_DIRTY_RAO) + if (dc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(dc); Ret = REGION_Complexity( dc->prgnRao ? dc->prgnRao : dc->prgnVis ); @@ -376,7 +376,7 @@ GdiGetClipBox( } /* Update RAO region if necessary */ - if (pdc->fs & DC_FLAG_DIRTY_RAO) + if (pdc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdc); /* Check if we have a RAO region (intersection of API and VIS region) */ @@ -577,7 +577,7 @@ NtGdiOffsetClipRgn( } /* Mark the RAO region as dirty */ - pdc->fs |= DC_FLAG_DIRTY_RAO; + pdc->fs |= DC_DIRTY_RAO; } else { @@ -656,7 +656,7 @@ NtGdiRectVisible( return FALSE; } - if (dc->fs & DC_FLAG_DIRTY_RAO) + if (dc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(dc); prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis; @@ -765,7 +765,7 @@ CLIPPING_UpdateGCRegion(PDC pDC) REGION_bOffsetRgn(pDC->prgnVis, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y); - pDC->fs &= ~DC_FLAG_DIRTY_RAO; + pDC->fs &= ~DC_DIRTY_RAO; UpdateVisRgn(pDC); return; } @@ -823,7 +823,7 @@ CLIPPING_UpdateGCRegion(PDC pDC) &pDC->prgnRao->rdh.rcBound, sizeof(RECTL)); - pDC->fs &= ~DC_FLAG_DIRTY_RAO; + pDC->fs &= ~DC_DIRTY_RAO; UpdateVisRgn(pDC); // pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build diff --git a/win32ss/gdi/ntgdi/dc.h b/win32ss/gdi/ntgdi/dc.h index 76e8745b73b..f18480c5a94 100644 --- a/win32ss/gdi/ntgdi/dc.h +++ b/win32ss/gdi/ntgdi/dc.h @@ -14,7 +14,7 @@ enum _FONT_STATE /* fl */ #define DC_FL_PAL_BACK 1 -enum _DCFLAGS +typedef enum _DCFLAGS { DC_DISPLAY = 0x0001, DC_DIRECT = 0x0002, @@ -34,13 +34,13 @@ enum _DCFLAGS #if DBG DC_PREPARED = 0x8000 #endif -}; +} DCFLAGS; typedef enum _DCTYPE { - DCTYPE_DIRECT = 0, - DCTYPE_MEMORY = 1, - DCTYPE_INFO = 2, + DCTYPE_DIRECT = 0, /* Normal device context */ + DCTYPE_MEMORY = 1, /* Memory device context */ + DCTYPE_INFO = 2, /* Information context */ } DCTYPE; diff --git a/win32ss/gdi/ntgdi/dclife.c b/win32ss/gdi/ntgdi/dclife.c index d94f69b9661..2a405ee7a93 100644 --- a/win32ss/gdi/ntgdi/dclife.c +++ b/win32ss/gdi/ntgdi/dclife.c @@ -546,7 +546,7 @@ DC_vPrepareDCsForBlit( prcSecond = NULL; } - if (pdcDest->fs & DC_FLAG_DIRTY_RAO) + if (pdcDest->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdcDest); /* Lock and update first DC */ @@ -905,7 +905,7 @@ IntGdiDeleteDC(HDC hDC, BOOL Force) * For some reason, it's still a valid handle, pointing to some kernel data. * Not sure if this is a bug, a feature, some cache stuff... Who knows? * See NtGdiDeleteObjectApp test for details */ - if (DCToDelete->fs & DC_FLAG_PERMANENT) + if (DCToDelete->fs & DC_PERMANANT) { DC_UnlockDc(DCToDelete); if(UserReleaseDC(NULL, hDC, FALSE)) @@ -972,16 +972,16 @@ MakeInfoDC(PDC pdc, BOOL bSet) SIZEL sizl; /* Can not be a display DC. */ - if (pdc->fs & DC_FLAG_DISPLAY) return FALSE; + if (pdc->fs & DC_DISPLAY) return FALSE; if (bSet) { - if (pdc->fs & DC_FLAG_TEMPINFODC || pdc->dctype == DC_TYPE_DIRECT) + if (pdc->fs & DC_TEMPINFODC || pdc->dctype == DCTYPE_DIRECT) return FALSE; pSurface = pdc->dclevel.pSurface; - pdc->fs |= DC_FLAG_TEMPINFODC; + pdc->fs |= DC_TEMPINFODC; pdc->pSurfInfo = pSurface; - pdc->dctype = DC_TYPE_INFO; + pdc->dctype = DCTYPE_INFO; pdc->dclevel.pSurface = NULL; PDEVOBJ_sizl(pdc->ppdev, &sizl); @@ -995,13 +995,13 @@ MakeInfoDC(PDC pdc, BOOL bSet) } else { - if (!(pdc->fs & DC_FLAG_TEMPINFODC) || pdc->dctype != DC_TYPE_INFO) + if (!(pdc->fs & DC_TEMPINFODC) || pdc->dctype != DCTYPE_INFO) return FALSE; pSurface = pdc->pSurfInfo; - pdc->fs &= ~DC_FLAG_TEMPINFODC; + pdc->fs &= ~DC_TEMPINFODC; pdc->dclevel.pSurface = pSurface; - pdc->dctype = DC_TYPE_DIRECT; + pdc->dctype = DCTYPE_DIRECT; pdc->pSurfInfo = NULL; if ( !pSurface || @@ -1050,7 +1050,7 @@ IntGdiCreateDC( pdmInit, NULL, CreateAsIC ? DCTYPE_INFO : - (Driver ? DC_TYPE_DIRECT : DC_TYPE_DIRECT), + (Driver ? DCTYPE_DIRECT : DCTYPE_DIRECT), TRUE, NULL, NULL, @@ -1065,10 +1065,10 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC) HDC hDC; UNIMPLEMENTED; - if (DcType == DC_TYPE_MEMORY) + if (DcType == DCTYPE_MEMORY) hDC = NtGdiCreateCompatibleDC(NULL); // OH~ Yuck! I think I taste vomit in my mouth! else - hDC = IntGdiCreateDC(NULL, NULL, NULL, NULL, (DcType == DC_TYPE_INFO)); + hDC = IntGdiCreateDC(NULL, NULL, NULL, NULL, (DcType == DCTYPE_INFO)); return hDC; } diff --git a/win32ss/gdi/ntgdi/dcobjs.c b/win32ss/gdi/ntgdi/dcobjs.c index 6820416f6f5..0b68dc211f9 100644 --- a/win32ss/gdi/ntgdi/dcobjs.c +++ b/win32ss/gdi/ntgdi/dcobjs.c @@ -361,7 +361,7 @@ NtGdiSelectBitmap( } /* Must be a memory dc to select a bitmap */ - if (pdc->dctype != DC_TYPE_MEMORY) + if (pdc->dctype != DCTYPE_MEMORY) { DC_UnlockDc(pdc); return NULL; @@ -462,7 +462,7 @@ NtGdiSelectBitmap( /* Mark the DC brushes and the RAO region invalid */ pdc->pdcattr->ulDirty_ |= DIRTY_FILL | DIRTY_LINE; - pdc->fs |= DC_FLAG_DIRTY_RAO; + pdc->fs |= DC_DIRTY_RAO; /* Update the system region */ REGION_SetRectRgn(pdc->prgnVis, @@ -733,7 +733,7 @@ NtGdiGetRandomRgn( break; case APIRGN: - if (pdc->fs & DC_FLAG_DIRTY_RAO) + if (pdc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdc); if (pdc->prgnAPI) { diff --git a/win32ss/gdi/ntgdi/dcstate.c b/win32ss/gdi/ntgdi/dcstate.c index 314eaa6c380..749f3c11517 100644 --- a/win32ss/gdi/ntgdi/dcstate.c +++ b/win32ss/gdi/ntgdi/dcstate.c @@ -63,7 +63,7 @@ DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To) pdcDst->dclevel.prgnMeta = IntSysCreateRectpRgn(0, 0, 0, 0); IntGdiCombineRgn(pdcDst->dclevel.prgnMeta, pdcSrc->dclevel.prgnMeta, NULL, RGN_COPY); } - pdcDst->fs |= DC_FLAG_DIRTY_RAO; + pdcDst->fs |= DC_DIRTY_RAO; } } @@ -109,7 +109,7 @@ IntGdiCleanDC(HDC hDC) REGION_Delete(dc->prgnAPI); dc->prgnRao = dc->prgnAPI = NULL; - dc->fs |= DC_FLAG_DIRTY_RAO; + dc->fs |= DC_DIRTY_RAO; DC_UnlockDc(dc); diff --git a/win32ss/gdi/ntgdi/dcutil.c b/win32ss/gdi/ntgdi/dcutil.c index d66086d72d8..d7dee5b5763 100644 --- a/win32ss/gdi/ntgdi/dcutil.c +++ b/win32ss/gdi/ntgdi/dcutil.c @@ -328,7 +328,7 @@ DCU_SetDcUndeletable(HDC hDC) return; } - dc->fs |= DC_FLAG_PERMANENT; + dc->fs |= DC_PERMANANT; DC_UnlockDc(dc); return; } @@ -430,7 +430,7 @@ IntGdiSetHookFlags(HDC hDC, WORD Flags) return 0; } - wRet = dc->fs & DC_FLAG_DIRTY_RAO; // FIXME: Wrong flag! + wRet = dc->fs & DC_DIRTY_RAO; // FIXME: Wrong flag! /* Info in "Undocumented Windows" is slightly confusing. */ DPRINT("DC %p, Flags %04x\n", hDC, Flags); @@ -438,11 +438,11 @@ IntGdiSetHookFlags(HDC hDC, WORD Flags) if (Flags & DCHF_INVALIDATEVISRGN) { /* hVisRgn has to be updated */ - dc->fs |= DC_FLAG_DIRTY_RAO; + dc->fs |= DC_DIRTY_RAO; } else if (Flags & DCHF_VALIDATEVISRGN || 0 == Flags) { - //dc->fs &= ~DC_FLAG_DIRTY_RAO; + //dc->fs &= ~DC_DIRTY_RAO; } DC_UnlockDc(dc); @@ -729,7 +729,7 @@ NtGdiGetBoundsRect( else { RECTL rcRgn; - if (pdc->fs & DC_FLAG_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdc); + if (pdc->fs & DC_DIRTY_RAO) CLIPPING_UpdateGCRegion(pdc); if(!REGION_GetRgnBox(pdc->prgnRao, &rcRgn)) { REGION_GetRgnBox(pdc->prgnVis, &rcRgn); diff --git a/win32ss/gdi/ntgdi/dibobj.c b/win32ss/gdi/ntgdi/dibobj.c index c2b5a8fbb42..6c6dd53e941 100644 --- a/win32ss/gdi/ntgdi/dibobj.c +++ b/win32ss/gdi/ntgdi/dibobj.c @@ -529,7 +529,7 @@ NtGdiSetDIBitsToDeviceInternal( goto Exit; } - if (pDC->dctype == DC_TYPE_INFO) + if (pDC->dctype == DCTYPE_INFO) { ret = 0; goto Exit; @@ -714,7 +714,7 @@ GreGetDIBitsInternal( return 0; pDC = DC_LockDc(hDC); - if (pDC == NULL || pDC->dctype == DC_TYPE_INFO) + if (pDC == NULL || pDC->dctype == DCTYPE_INFO) { ScanLines = 0; goto done; diff --git a/win32ss/gdi/ntgdi/palette.c b/win32ss/gdi/ntgdi/palette.c index 31cd4f5f3fd..a36dbf90777 100644 --- a/win32ss/gdi/ntgdi/palette.c +++ b/win32ss/gdi/ntgdi/palette.c @@ -770,7 +770,7 @@ IntGdiRealizePalette(HDC hDC) ASSERT(ppalDC->flFlags & PAL_INDEXED); DPRINT1("RealizePalette unimplemented for %s\n", - (pdc->dctype == DC_TYPE_MEMORY ? "memory managed DCs" : "device DCs")); + (pdc->dctype == DCTYPE_MEMORY ? "memory managed DCs" : "device DCs")); cleanup: DC_UnlockDc(pdc); diff --git a/win32ss/include/ntgdihdl.h b/win32ss/include/ntgdihdl.h index c81f01341cf..8296be8ff22 100644 --- a/win32ss/include/ntgdihdl.h +++ b/win32ss/include/ntgdihdl.h @@ -119,28 +119,6 @@ #define GDI_OBJ_HMGR_RESTRICTED 0x80000022 /* Restricted? */ -/* DC OBJ Types */ -#define DC_TYPE_DIRECT 0 /* normal device context */ -#define DC_TYPE_MEMORY 1 /* memory device context */ -#define DC_TYPE_INFO 2 /* information context */ - -/* DC OBJ Flags */ -#define DC_FLAG_DISPLAY 0x0001 -#define DC_FLAG_DIRECT 0x0002 -#define DC_FLAG_CANCELLED 0x0004 -#define DC_FLAG_PERMANENT 0x0008 -#define DC_FLAG_DIRTY_RAO 0x0010 -#define DC_FLAG_ACCUM_WMGR 0x0020 -#define DC_FLAG_ACCUM_APP 0x0040 -#define DC_FLAG_RESET 0x0080 -#define DC_FLAG_SYNCHRONIZEACCESS 0x0100 -#define DC_FLAG_EPSPRINTINGESCAPE 0x0200 -#define DC_FLAG_TEMPINFODC 0x0400 -#define DC_FLAG_FULLSCREEN 0x0800 -#define DC_FLAG_IN_CLONEPDEV 0x1000 -#define DC_FLAG_REDIRECTION 0x2000 -#define DC_FLAG_SHAREACCESS 0x4000 - /* DC_ATTR Dirty Flags */ #define DIRTY_FILL 0x00000001 #define DIRTY_LINE 0x00000002 diff --git a/win32ss/reactx/ntddraw/dxeng.c b/win32ss/reactx/ntddraw/dxeng.c index 7004e58e480..8e280f4734b 100644 --- a/win32ss/reactx/ntddraw/dxeng.c +++ b/win32ss/reactx/ntddraw/dxeng.c @@ -461,7 +461,7 @@ DxEngGetDCState(HDC hDC, switch (type) { case 1: - retVal = (DWORD_PTR) pDC->fs & DC_FLAG_FULLSCREEN; + retVal = (DWORD_PTR) pDC->fs & DC_FULLSCREEN; break; case 2: /* Return the complexity of the visible region. */ @@ -656,7 +656,7 @@ HDC APIENTRY DxEngCreateMemoryDC(HDEV hDev) { - return IntGdiCreateDisplayDC(hDev, DC_TYPE_MEMORY, FALSE); + return IntGdiCreateDisplayDC(hDev, DCTYPE_MEMORY, FALSE); } /************************************************************************/ @@ -748,9 +748,9 @@ DxEngSetDCState(HDC hDC, DWORD SetType, DWORD Set) if (SetType == 1) { if ( Set ) - pDC->fs |= DC_FLAG_FULLSCREEN; + pDC->fs |= DC_FULLSCREEN; else - pDC->fs &= ~DC_FLAG_FULLSCREEN; + pDC->fs &= ~DC_FULLSCREEN; Ret = TRUE; } DC_UnlockDc(pDC); diff --git a/win32ss/user/ntuser/desktop.c b/win32ss/user/ntuser/desktop.c index 43120cc7750..11f3de29c78 100644 --- a/win32ss/user/ntuser/desktop.c +++ b/win32ss/user/ntuser/desktop.c @@ -1550,7 +1550,7 @@ UserGetDesktopDC(ULONG DcType, BOOL bAltDc, BOOL ValidatehWnd) /* This can be called from GDI/DX, so acquire the USER lock */ UserEnterExclusive(); - if (DcType == DC_TYPE_DIRECT) + if (DcType == DCTYPE_DIRECT) { DesktopObject = UserGetDesktopWindow(); DesktopHDC = (HDC)UserGetWindowDC(DesktopObject); diff --git a/win32ss/user/ntuser/windc.c b/win32ss/user/ntuser/windc.c index 9b60c568ba1..8b865dcb908 100644 --- a/win32ss/user/ntuser/windc.c +++ b/win32ss/user/ntuser/windc.c @@ -874,7 +874,7 @@ DceResetActiveDCEs(PWND Window) if (NULL != dc->dclevel.prgnClip) { REGION_bOffsetRgn(dc->dclevel.prgnClip, DeltaX, DeltaY); - dc->fs |= DC_FLAG_DIRTY_RAO; + dc->fs |= DC_DIRTY_RAO; } if (NULL != pDCE->hrgnClip) {
2 years, 9 months
1
0
0
0
[reactos] 01/03: [WIN32SS:NTUSER] Use kernel handle in W32kOpenFile().
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1c2b757a64136aae863cf…
commit 1c2b757a64136aae863cfd76f331bffe0f7b7a66 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jan 12 16:50:35 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Mar 19 17:04:30 2022 +0100 [WIN32SS:NTUSER] Use kernel handle in W32kOpenFile(). --- win32ss/user/ntuser/misc/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/misc/file.c b/win32ss/user/ntuser/misc/file.c index 5dcd20a020a..988703705dc 100644 --- a/win32ss/user/ntuser/misc/file.c +++ b/win32ss/user/ntuser/misc/file.c @@ -52,7 +52,11 @@ W32kOpenFile(PCWSTR pwszFileName, DWORD dwDesiredAccess) RtlInitUnicodeString(&ustrFile, pwszFileName); - InitializeObjectAttributes(&ObjectAttributes, &ustrFile, 0, NULL, NULL); + InitializeObjectAttributes(&ObjectAttributes, + &ustrFile, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); Status = ZwCreateFile(&hFile, dwDesiredAccess,
2 years, 9 months
1
0
0
0
[reactos] 01/01: [FREELDR] Use safe-string buffer printf to initialize the returned strings in WinLdrGetNLSNames().
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d535ecf1dc0e69b2e84dc…
commit d535ecf1dc0e69b2e84dc7f3c716c3f9fe15b6ad Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Mar 19 16:56:13 2022 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Mar 19 16:56:13 2022 +0100 [FREELDR] Use safe-string buffer printf to initialize the returned strings in WinLdrGetNLSNames(). This will also stop the GCC 9+ warnings, see PR #4385. --- boot/freeldr/freeldr/ntldr/wlregistry.c | 51 ++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/boot/freeldr/freeldr/ntldr/wlregistry.c b/boot/freeldr/freeldr/ntldr/wlregistry.c index 4f82fb82b97..56702e26703 100644 --- a/boot/freeldr/freeldr/ntldr/wlregistry.c +++ b/boot/freeldr/freeldr/ntldr/wlregistry.c @@ -19,9 +19,13 @@ DBG_DEFAULT_CHANNEL(WINDOWS); ULONG TotalNLSSize = 0; static BOOLEAN -WinLdrGetNLSNames(PSTR AnsiName, - PSTR OemName, - PSTR LangName); +WinLdrGetNLSNames( + _Out_z_bytecap_(AnsiNameSize) PSTR AnsiName, + _In_ SIZE_T AnsiNameSize, + _Out_z_bytecap_(OemNameSize) PSTR OemName, + _In_ SIZE_T OemNameSize, + _Out_z_bytecap_(LangNameSize) PSTR LangName, + _In_ SIZE_T LangNameSize); static VOID WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead, @@ -173,15 +177,17 @@ WinLdrInitSystemHive( BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot) { + BOOLEAN Success; CHAR SearchPath[1024]; CHAR AnsiName[256], OemName[256], LangName[256]; - BOOLEAN Success; /* Scan registry and prepare boot drivers list */ WinLdrScanRegistry(&LoaderBlock->BootDriverListHead, SystemRoot); /* Get names of NLS files */ - Success = WinLdrGetNLSNames(AnsiName, OemName, LangName); + Success = WinLdrGetNLSNames(AnsiName, sizeof(AnsiName), + OemName, sizeof(OemName), + LangName, sizeof(LangName)); if (!Success) { UiMessageBox("Getting NLS names from registry failed!"); @@ -207,16 +213,21 @@ BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, /* PRIVATE FUNCTIONS ******************************************************/ // Queries registry for those three file names +_Use_decl_annotations_ static BOOLEAN -WinLdrGetNLSNames(PSTR AnsiName, - PSTR OemName, - PSTR LangName) +WinLdrGetNLSNames( + _Out_ PSTR AnsiName, + _In_ SIZE_T AnsiNameSize, + _Out_ PSTR OemName, + _In_ SIZE_T OemNameSize, + _Out_ PSTR LangName, + _In_ SIZE_T LangNameSize) { LONG rc = ERROR_SUCCESS; HKEY hKey; + ULONG BufferSize; WCHAR szIdBuffer[80]; WCHAR NameBuffer[80]; - ULONG BufferSize; /* Open the CodePage key */ rc = RegOpenKey(NULL, @@ -224,7 +235,7 @@ WinLdrGetNLSNames(PSTR AnsiName, &hKey); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "Couldn't open CodePage registry key"); + //TRACE("Couldn't open CodePage registry key"); return FALSE; } @@ -233,7 +244,7 @@ WinLdrGetNLSNames(PSTR AnsiName, rc = RegQueryValue(hKey, L"ACP", NULL, (PUCHAR)szIdBuffer, &BufferSize); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "Couldn't get ACP NLS setting"); + //TRACE("Couldn't get ACP NLS setting"); RegCloseKey(hKey); return FALSE; } @@ -242,19 +253,19 @@ WinLdrGetNLSNames(PSTR AnsiName, rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)NameBuffer, &BufferSize); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "ACP NLS Setting exists, but isn't readable"); + //TRACE("ACP NLS Setting exists, but isn't readable"); //RegCloseKey(hKey); //return FALSE; wcscpy(NameBuffer, L"c_1252.nls"); // HACK: ReactOS bug CORE-6105 } - sprintf(AnsiName, "%S", NameBuffer); + RtlStringCbPrintfA(AnsiName, AnsiNameSize, "%S", NameBuffer); /* Get OEM codepage */ BufferSize = sizeof(szIdBuffer); rc = RegQueryValue(hKey, L"OEMCP", NULL, (PUCHAR)szIdBuffer, &BufferSize); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "Couldn't get OEMCP NLS setting"); + //TRACE("Couldn't get OEMCP NLS setting"); RegCloseKey(hKey); return FALSE; } @@ -263,12 +274,12 @@ WinLdrGetNLSNames(PSTR AnsiName, rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)NameBuffer, &BufferSize); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "OEMCP NLS setting exists, but isn't readable"); + //TRACE("OEMCP NLS setting exists, but isn't readable"); //RegCloseKey(hKey); //return FALSE; wcscpy(NameBuffer, L"c_437.nls"); // HACK: ReactOS bug CORE-6105 } - sprintf(OemName, "%S", NameBuffer); + RtlStringCbPrintfA(OemName, OemNameSize, "%S", NameBuffer); RegCloseKey(hKey); @@ -278,7 +289,7 @@ WinLdrGetNLSNames(PSTR AnsiName, &hKey); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "Couldn't open Language registry key"); + //TRACE("Couldn't open Language registry key"); return FALSE; } @@ -287,7 +298,7 @@ WinLdrGetNLSNames(PSTR AnsiName, rc = RegQueryValue(hKey, L"Default", NULL, (PUCHAR)szIdBuffer, &BufferSize); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "Couldn't get Language Default setting"); + //TRACE("Couldn't get Language Default setting"); RegCloseKey(hKey); return FALSE; } @@ -296,11 +307,11 @@ WinLdrGetNLSNames(PSTR AnsiName, rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)NameBuffer, &BufferSize); if (rc != ERROR_SUCCESS) { - //RtlStringCbCopyA(szErrorOut, sizeof(szErrorOut), "Language Default setting exists, but isn't readable"); + //TRACE("Language Default setting exists, but isn't readable"); RegCloseKey(hKey); return FALSE; } - sprintf(LangName, "%S", NameBuffer); + RtlStringCbPrintfA(LangName, LangNameSize, "%S", NameBuffer); RegCloseKey(hKey); return TRUE;
2 years, 9 months
1
0
0
0
[reactos] 01/01: [FREELDR] Allow booting from NTFS volume. (#3775)
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d01f9489257e9e89528a5…
commit d01f9489257e9e89528a5d85af84bcd05d3cd87b Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Mar 19 17:44:42 2022 +0300 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Mar 19 15:44:42 2022 +0100 [FREELDR] Allow booting from NTFS volume. (#3775) --- boot/freeldr/freeldr/include/fs/ntfs.h | 8 ++++++-- boot/freeldr/freeldr/lib/fs/ntfs.c | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/boot/freeldr/freeldr/include/fs/ntfs.h b/boot/freeldr/freeldr/include/fs/ntfs.h index b1915e79619..9aad54904d7 100644 --- a/boot/freeldr/freeldr/include/fs/ntfs.h +++ b/boot/freeldr/freeldr/include/fs/ntfs.h @@ -65,6 +65,8 @@ #define NTFS_FILE_NAME_DOS 2 #define NTFS_FILE_NAME_WIN32_AND_DOS 3 +#define NTFS_MFT_MASK 0x0000FFFFFFFFFFFFULL + #include <pshpack1.h> typedef struct { @@ -115,6 +117,8 @@ typedef struct ULONG BytesAllocated; ULONGLONG BaseMFTRecord; USHORT NextAttributeInstance; + USHORT Padding; // Align to 4 UCHAR boundary (NTFS 3.1+ (Windows XP and above)) + ULONG MFTRecordNumber; // Number of this MFT Record (NTFS 3.1+ (Windows XP and above)) } NTFS_MFT_RECORD, *PNTFS_MFT_RECORD; typedef struct @@ -185,7 +189,7 @@ typedef struct USHORT Reserved; UCHAR FileNameLength; UCHAR FileNameType; - WCHAR FileName[0]; + WCHAR FileName[1]; } NTFS_FILE_NAME_ATTR, *PNTFS_FILE_NAME_ATTR; typedef struct @@ -197,7 +201,7 @@ typedef struct ULONGLONG StartingVCN; ULONGLONG BaseFileRef; USHORT AttrId; - PWCHAR Name; + WCHAR Name[1]; } NTFS_ATTR_LIST_ATTR, *PNTFS_ATTR_LIST_ATTR; typedef struct diff --git a/boot/freeldr/freeldr/lib/fs/ntfs.c b/boot/freeldr/freeldr/lib/fs/ntfs.c index 233a2e5ac23..c7e41c23ef8 100644 --- a/boot/freeldr/freeldr/lib/fs/ntfs.c +++ b/boot/freeldr/freeldr/lib/fs/ntfs.c @@ -505,7 +505,7 @@ VOID NtfsPrintFile(PNTFS_INDEX_ENTRY IndexEntry) AnsiFileName[i] = (CHAR)FileName[i]; AnsiFileName[i] = 0; - TRACE("- %s (%x)\n", AnsiFileName, IndexEntry->Data.Directory.IndexedFile); + TRACE("- %s (%x)\n", AnsiFileName, (IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK)); } #endif @@ -596,7 +596,7 @@ static BOOLEAN NtfsFindMftRecord(PNTFS_VOLUME_INFO Volume, ULONGLONG MFTIndex, P { if (NtfsCompareFileName(FileName, IndexEntry)) { - *OutMFTIndex = IndexEntry->Data.Directory.IndexedFile; + *OutMFTIndex = (IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK); FrLdrTempFree(IndexRecord, TAG_NTFS_INDEX_REC); FrLdrTempFree(MftRecord, TAG_NTFS_MFT); return TRUE; @@ -680,7 +680,7 @@ static BOOLEAN NtfsFindMftRecord(PNTFS_VOLUME_INFO Volume, ULONGLONG MFTIndex, P if (NtfsCompareFileName(FileName, IndexEntry)) { TRACE("File found\n"); - *OutMFTIndex = IndexEntry->Data.Directory.IndexedFile; + *OutMFTIndex = (IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK); FrLdrTempFree(BitmapData, TAG_NTFS_BITMAP); FrLdrTempFree(IndexRecord, TAG_NTFS_INDEX_REC); FrLdrTempFree(MftRecord, TAG_NTFS_MFT);
2 years, 9 months
1
0
0
0
[reactos] 01/01: [RAPPS] Fix uninstalling applications
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1eed7ca9a9e3b416f9108…
commit 1eed7ca9a9e3b416f9108cf21eb2710bb560092d Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Tue Mar 15 21:56:01 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Mar 19 13:32:51 2022 +0100 [RAPPS] Fix uninstalling applications - 'WindowsInstaller' setups do not fill the UninstallString and ModifyPath with the needed info, so manually calculate those. - Fix the case where REG_EXPAND_SZ is used instead of REG_SZ - Take NoModify into account --- base/applications/rapps/installed.cpp | 66 ++++++++++++++++++++++++++++++++--- base/applications/rapps/misc.cpp | 2 +- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/base/applications/rapps/installed.cpp b/base/applications/rapps/installed.cpp index fed899e9448..3528c2c3aaa 100644 --- a/base/applications/rapps/installed.cpp +++ b/base/applications/rapps/installed.cpp @@ -71,8 +71,40 @@ void CInstalledApplicationInfo::EnsureDetailsLoaded() } GetApplicationRegString(L"InstallLocation", szInstallLocation); GetApplicationRegString(L"InstallSource", szInstallSource); - GetApplicationRegString(L"UninstallString", szUninstallString); - GetApplicationRegString(L"ModifyPath",szModifyPath); + DWORD dwWindowsInstaller = 0; + if (GetApplicationRegDword(L"WindowsInstaller", &dwWindowsInstaller) && dwWindowsInstaller) + { + // MSI has the same info in Uninstall / modify, so manually build it + szUninstallString.Format(L"msiexec /x%s", m_szKeyName.GetString()); + } + else + { + GetApplicationRegString(L"UninstallString", szUninstallString); + } + DWORD dwNoModify = 0; + if (!GetApplicationRegDword(L"NoModify", &dwNoModify)) + { + CStringW Tmp; + if (GetApplicationRegString(L"NoModify", Tmp)) + { + dwNoModify = Tmp.GetLength() > 0 ? (Tmp[0] == '1') : 0; + } + else + { + dwNoModify = 0; + } + } + if (!dwNoModify) + { + if (dwWindowsInstaller) + { + szModifyPath.Format(L"msiexec /i%s", m_szKeyName.GetString()); + } + else + { + GetApplicationRegString(L"ModifyPath", szModifyPath); + } + } CloseHandle(m_hSubKey); m_hSubKey = NULL; @@ -84,8 +116,13 @@ BOOL CInstalledApplicationInfo::GetApplicationRegString(LPCWSTR lpKeyName, ATL:: DWORD dwAllocated = 0, dwSize, dwType; // retrieve the size of value first. - if (RegQueryValueExW(m_hSubKey, lpKeyName, NULL, &dwType, NULL, &dwAllocated) != ERROR_SUCCESS || - dwType != REG_SZ) + if (RegQueryValueExW(m_hSubKey, lpKeyName, NULL, &dwType, NULL, &dwAllocated) != ERROR_SUCCESS) + { + String.Empty(); + return FALSE; + } + + if (dwType != REG_SZ && dwType != REG_EXPAND_SZ) { String.Empty(); return FALSE; @@ -106,6 +143,27 @@ BOOL CInstalledApplicationInfo::GetApplicationRegString(LPCWSTR lpKeyName, ATL:: return FALSE; } + if (dwType == REG_EXPAND_SZ) + { + CStringW Tmp; + + DWORD dwLen = ExpandEnvironmentStringsW(String, NULL, 0); + if (dwLen > 0) + { + BOOL bSuccess = ExpandEnvironmentStringsW(String, Tmp.GetBuffer(dwLen), dwLen) == dwLen; + Tmp.ReleaseBuffer(dwLen - 1); + if (bSuccess) + { + String = Tmp; + } + else + { + String.Empty(); + return FALSE; + } + } + } + return TRUE; } diff --git a/base/applications/rapps/misc.cpp b/base/applications/rapps/misc.cpp index 80bd875008a..da350ad1210 100644 --- a/base/applications/rapps/misc.cpp +++ b/base/applications/rapps/misc.cpp @@ -247,7 +247,7 @@ BOOL GetInstalledVersion_WowUser(ATL::CStringW* szVersionResult, BOOL bHasSucceded = FALSE; ATL::CRegKey key; ATL::CStringW szVersion; - ATL::CStringW szPath = ATL::CStringW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%ls") + szRegName; + ATL::CStringW szPath = ATL::CStringW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\") + szRegName; if (key.Open(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, szPath.GetString(),
2 years, 9 months
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
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
Results per page:
10
25
50
100
200