C to C++ migration and refactoring #17
@@ -11,10 +11,18 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define XTCLINK extern "C"
|
/* C++ definitions */
|
||||||
|
#define XTCLINK extern "C"
|
||||||
|
#define NULLPTR nullptr
|
||||||
|
|
||||||
|
/* C++ types */
|
||||||
typedef wchar_t wchar;
|
typedef wchar_t wchar;
|
||||||
#else
|
#else
|
||||||
|
/* C definitions */
|
||||||
#define XTCLINK
|
#define XTCLINK
|
||||||
|
#define NULLPTR ((void *)0)
|
||||||
|
|
||||||
|
/* C types */
|
||||||
typedef unsigned short wchar;
|
typedef unsigned short wchar;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -29,10 +29,6 @@
|
|||||||
#define UNION union
|
#define UNION union
|
||||||
#define VOLATILE volatile
|
#define VOLATILE volatile
|
||||||
|
|
||||||
/* NULL values */
|
|
||||||
#define NULL ((PVOID) 0)
|
|
||||||
#define NULL64 ((VOID * PVOID) 0)
|
|
||||||
|
|
||||||
/* Type limits */
|
/* Type limits */
|
||||||
#define MINCHAR 0x80
|
#define MINCHAR 0x80
|
||||||
#define MAXCHAR 0x7F
|
#define MAXCHAR 0x7F
|
||||||
|
@@ -296,7 +296,7 @@ BlpGetNextPageTable(IN PXTBL_PAGE_MAPPING PageMap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Add new memory mapping */
|
/* Add new memory mapping */
|
||||||
Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)(UINT_PTR)Address, 1, LoaderMemoryData);
|
Status = BlMapVirtualMemory(PageMap, NULLPTR, (PVOID)(UINT_PTR)Address, 1, LoaderMemoryData);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Memory mapping failure */
|
/* Memory mapping failure */
|
||||||
|
@@ -357,7 +357,7 @@ BlpGetNextPageTable(IN PXTBL_PAGE_MAPPING PageMap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Add new memory mapping */
|
/* Add new memory mapping */
|
||||||
Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)(UINT_PTR)Address, 1, LoaderMemoryData);
|
Status = BlMapVirtualMemory(PageMap, NULLPTR, (PVOID)(UINT_PTR)Address, 1, LoaderMemoryData);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Memory mapping failure */
|
/* Memory mapping failure */
|
||||||
|
@@ -31,7 +31,7 @@ BlGetBooleanParameter(IN CONST PWCHAR Parameters,
|
|||||||
SIZE_T NeedleLength, TokenLength;
|
SIZE_T NeedleLength, TokenLength;
|
||||||
|
|
||||||
/* Validate input data and ensure the option is not an empty string */
|
/* Validate input data and ensure the option is not an empty string */
|
||||||
if(Parameters == NULL || Needle == NULL || *Needle == L'\0')
|
if(Parameters == NULLPTR || Needle == NULLPTR || *Needle == L'\0')
|
||||||
{
|
{
|
||||||
/* One of the parameters was invalid */
|
/* One of the parameters was invalid */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -38,7 +38,7 @@ BlGetBootOptionValue(IN PLIST_ENTRY Options,
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
/* Assume the option will not be found */
|
/* Assume the option will not be found */
|
||||||
*OptionValue = NULL;
|
*OptionValue = NULLPTR;
|
||||||
|
|
||||||
/* Get the length of the option name we are looking for */
|
/* Get the length of the option name we are looking for */
|
||||||
KeyLength = RtlWideStringLength(OptionName, 0);
|
KeyLength = RtlWideStringLength(OptionName, 0);
|
||||||
@@ -62,7 +62,7 @@ BlGetBootOptionValue(IN PLIST_ENTRY Options,
|
|||||||
{
|
{
|
||||||
/* Memory allocation failure, print debug message and return status code */
|
/* Memory allocation failure, print debug message and return status code */
|
||||||
BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%zX)\n", Status);
|
BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%zX)\n", Status);
|
||||||
*OptionValue = NULL;
|
*OptionValue = NULLPTR;
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ BlGetConfigBooleanValue(IN CONST PWCHAR ConfigName)
|
|||||||
* @param ConfigName
|
* @param ConfigName
|
||||||
* Specifies the configuration key to return its value.
|
* Specifies the configuration key to return its value.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the configuration value, or NULL if key was not found.
|
* @return This routine returns a pointer to the configuration value, or NULLPTR if key was not found.
|
||||||
*
|
*
|
||||||
* @since XT 1.0
|
* @since XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -137,7 +137,7 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName,
|
|||||||
PWCHAR Value;
|
PWCHAR Value;
|
||||||
|
|
||||||
/* Assume the option will not be found */
|
/* Assume the option will not be found */
|
||||||
*ConfigValue = NULL;
|
*ConfigValue = NULLPTR;
|
||||||
|
|
||||||
/* Get config entry name length */
|
/* Get config entry name length */
|
||||||
KeyLength = RtlWideStringLength(ConfigName, 0);
|
KeyLength = RtlWideStringLength(ConfigName, 0);
|
||||||
@@ -159,7 +159,7 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName,
|
|||||||
Status = BlAllocateMemoryPool((ValueLength + 1) * sizeof(WCHAR), (PVOID *)&Value);
|
Status = BlAllocateMemoryPool((ValueLength + 1) * sizeof(WCHAR), (PVOID *)&Value);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Memory allocation failure, return NULL */
|
/* Memory allocation failure, return NULLPTR */
|
||||||
BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%zX)\n", Status);
|
BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%zX)\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName,
|
|||||||
ConfigListEntry = ConfigListEntry->Flink;
|
ConfigListEntry = ConfigListEntry->Flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Config entry not found, return NULL */
|
/* Config entry not found, return NULLPTR */
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ BlpParseCommandLine(VOID)
|
|||||||
Argument = RtlTokenizeWideString(LoadedImage->LoadOptions, L" ", &LastArg);
|
Argument = RtlTokenizeWideString(LoadedImage->LoadOptions, L" ", &LastArg);
|
||||||
|
|
||||||
/* Iterate over all arguments passed to boot loader */
|
/* Iterate over all arguments passed to boot loader */
|
||||||
while(Argument != NULL)
|
while(Argument != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Store key name */
|
/* Store key name */
|
||||||
Key = Argument;
|
Key = Argument;
|
||||||
@@ -573,7 +573,7 @@ BlpParseCommandLine(VOID)
|
|||||||
RtlInsertTailList(&Config, &Option->Flink);
|
RtlInsertTailList(&Config, &Option->Flink);
|
||||||
|
|
||||||
/* Take next argument */
|
/* Take next argument */
|
||||||
Argument = RtlTokenizeWideString(NULL, L" ", &LastArg);
|
Argument = RtlTokenizeWideString(NULLPTR, L" ", &LastArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update global configuration */
|
/* Update global configuration */
|
||||||
@@ -611,11 +611,11 @@ BlpParseConfigFile(IN CONST PCHAR RawConfig,
|
|||||||
|
|
||||||
/* Initialize pointers */
|
/* Initialize pointers */
|
||||||
InputData = RawConfig;
|
InputData = RawConfig;
|
||||||
Section = NULL;
|
Section = NULLPTR;
|
||||||
Option = NULL;
|
Option = NULLPTR;
|
||||||
SectionName = NULL;
|
SectionName = NULLPTR;
|
||||||
Key = NULL;
|
Key = NULLPTR;
|
||||||
Value = NULL;
|
Value = NULLPTR;
|
||||||
|
|
||||||
/* Analyze configuration data until end of file is reached */
|
/* Analyze configuration data until end of file is reached */
|
||||||
while(*InputData != '\0')
|
while(*InputData != '\0')
|
||||||
@@ -812,7 +812,7 @@ BlpReadConfigFile(IN CONST PWCHAR ConfigDirectory,
|
|||||||
SIZE_T FileSize;
|
SIZE_T FileSize;
|
||||||
|
|
||||||
/* Open EFI volume */
|
/* Open EFI volume */
|
||||||
Status = BlOpenVolume(NULL, &DiskHandle, &FsHandle);
|
Status = BlOpenVolume(NULLPTR, &DiskHandle, &FsHandle);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to open a volume */
|
/* Failed to open a volume */
|
||||||
@@ -872,7 +872,7 @@ BlpUpdateConfiguration(IN PLIST_ENTRY NewConfig)
|
|||||||
|
|
||||||
/* Make sure config entry does not exist yet */
|
/* Make sure config entry does not exist yet */
|
||||||
BlGetConfigValue(ConfigEntry->Name, &ConfigValue);
|
BlGetConfigValue(ConfigEntry->Name, &ConfigValue);
|
||||||
if(ConfigValue == NULL)
|
if(ConfigValue == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Remove new config entry from input list and put it into global config list */
|
/* Remove new config entry from input list and put it into global config list */
|
||||||
RtlRemoveEntryList(&ConfigEntry->Flink);
|
RtlRemoveEntryList(&ConfigEntry->Flink);
|
||||||
|
@@ -111,7 +111,7 @@ BlpInitializeDebugConsole()
|
|||||||
DebugPort = RtlTokenizeWideString(DebugConfiguration, L";", &LastPort);
|
DebugPort = RtlTokenizeWideString(DebugConfiguration, L";", &LastPort);
|
||||||
|
|
||||||
/* Iterate over all debug ports */
|
/* Iterate over all debug ports */
|
||||||
while(DebugPort != NULL)
|
while(DebugPort != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Check what port is set for debugging */
|
/* Check what port is set for debugging */
|
||||||
if(RtlCompareWideStringInsensitive(DebugPort, L"COM", 3) == 0)
|
if(RtlCompareWideStringInsensitive(DebugPort, L"COM", 3) == 0)
|
||||||
@@ -183,7 +183,7 @@ BlpInitializeDebugConsole()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Take next debug port */
|
/* Take next debug port */
|
||||||
DebugPort = RtlTokenizeWideString(NULL, L";", &LastPort);
|
DebugPort = RtlTokenizeWideString(NULLPTR, L";", &LastPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if serial debug port is enabled */
|
/* Check if serial debug port is enabled */
|
||||||
|
@@ -144,7 +144,7 @@ BlGetConfigurationTable(IN PEFI_GUID TableGuid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Table not found */
|
/* Table not found */
|
||||||
*Table = NULL;
|
*Table = NULLPTR;
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ BlGetEfiVariable(IN PEFI_GUID Vendor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt to get variable value */
|
/* Attempt to get variable value */
|
||||||
Status = EfiSystemTable->RuntimeServices->GetVariable(VariableName, Vendor, NULL, &Size, Buffer);
|
Status = EfiSystemTable->RuntimeServices->GetVariable(VariableName, Vendor, NULLPTR, &Size, Buffer);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to get variable, probably not found such one */
|
/* Failed to get variable, probably not found such one */
|
||||||
@@ -239,12 +239,12 @@ BlGetSecureBootStatus()
|
|||||||
|
|
||||||
Size = sizeof(VarValue);
|
Size = sizeof(VarValue);
|
||||||
if(EfiSystemTable->RuntimeServices->GetVariable(L"SecureBoot", &VarGuid,
|
if(EfiSystemTable->RuntimeServices->GetVariable(L"SecureBoot", &VarGuid,
|
||||||
NULL, &Size, &VarValue) == STATUS_EFI_SUCCESS)
|
NULLPTR, &Size, &VarValue) == STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
SecureBootStatus = (INT_PTR)VarValue;
|
SecureBootStatus = (INT_PTR)VarValue;
|
||||||
|
|
||||||
if((EfiSystemTable->RuntimeServices->GetVariable(L"SetupMode", &VarGuid,
|
if((EfiSystemTable->RuntimeServices->GetVariable(L"SetupMode", &VarGuid,
|
||||||
NULL, &Size, &VarValue) == STATUS_EFI_SUCCESS) && VarValue != 0)
|
NULLPTR, &Size, &VarValue) == STATUS_EFI_SUCCESS) && VarValue != 0)
|
||||||
{
|
{
|
||||||
SecureBootStatus = -1;
|
SecureBootStatus = -1;
|
||||||
}
|
}
|
||||||
@@ -274,11 +274,11 @@ BlInitializeEntropy(PULONGLONG RNGBuffer)
|
|||||||
ULONGLONG Seed;
|
ULONGLONG Seed;
|
||||||
|
|
||||||
/* Initialize variables */
|
/* Initialize variables */
|
||||||
Rng = NULL;
|
Rng = NULLPTR;
|
||||||
Seed = 0;
|
Seed = 0;
|
||||||
|
|
||||||
/* Locate RNG protocol */
|
/* Locate RNG protocol */
|
||||||
Status = EfiSystemTable->BootServices->LocateProtocol(&RngGuid, NULL, (PVOID *)&Rng);
|
Status = EfiSystemTable->BootServices->LocateProtocol(&RngGuid, NULLPTR, (PVOID *)&Rng);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to locate RNG protocol, return status code */
|
/* Failed to locate RNG protocol, return status code */
|
||||||
@@ -286,7 +286,7 @@ BlInitializeEntropy(PULONGLONG RNGBuffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get RNG value using the default algorithm */
|
/* Get RNG value using the default algorithm */
|
||||||
Status = Rng->GetRNG(Rng, NULL, 8, (PUCHAR)&Seed);
|
Status = Rng->GetRNG(Rng, NULLPTR, 8, (PUCHAR)&Seed);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to get RNG value, return status code */
|
/* Failed to get RNG value, return status code */
|
||||||
@@ -340,7 +340,7 @@ EFI_STATUS
|
|||||||
BlRebootSystem()
|
BlRebootSystem()
|
||||||
{
|
{
|
||||||
/* Reboot machine */
|
/* Reboot machine */
|
||||||
return EfiSystemTable->RuntimeServices->ResetSystem(EfiResetCold, STATUS_EFI_SUCCESS, 0, NULL);
|
return EfiSystemTable->RuntimeServices->ResetSystem(EfiResetCold, STATUS_EFI_SUCCESS, 0, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -388,7 +388,7 @@ EFI_STATUS
|
|||||||
BlShutdownSystem()
|
BlShutdownSystem()
|
||||||
{
|
{
|
||||||
/* Shutdown machine */
|
/* Shutdown machine */
|
||||||
return EfiSystemTable->RuntimeServices->ResetSystem(EfiResetShutdown, STATUS_EFI_SUCCESS, 0, NULL);
|
return EfiSystemTable->RuntimeServices->ResetSystem(EfiResetShutdown, STATUS_EFI_SUCCESS, 0, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -422,7 +422,7 @@ XTCDECL
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
BlStartEfiImage(IN EFI_HANDLE ImageHandle)
|
BlStartEfiImage(IN EFI_HANDLE ImageHandle)
|
||||||
{
|
{
|
||||||
return EfiSystemTable->BootServices->StartImage(ImageHandle, NULL, NULL);
|
return EfiSystemTable->BootServices->StartImage(ImageHandle, NULLPTR, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -25,7 +25,7 @@ LIST_ENTRY BlpConfigSections;
|
|||||||
PWCHAR BlpEditableConfigOptions[] = {
|
PWCHAR BlpEditableConfigOptions[] = {
|
||||||
L"BootModules", L"SystemType", L"SystemPath",
|
L"BootModules", L"SystemType", L"SystemPath",
|
||||||
L"KernelFile", L"InitrdFile", L"HalFile",
|
L"KernelFile", L"InitrdFile", L"HalFile",
|
||||||
L"Parameters", NULL
|
L"Parameters", NULLPTR
|
||||||
};
|
};
|
||||||
|
|
||||||
/* XT Boot Loader protocol */
|
/* XT Boot Loader protocol */
|
||||||
@@ -35,7 +35,7 @@ XTBL_LOADER_PROTOCOL BlpLdrProtocol;
|
|||||||
LIST_ENTRY BlpLoadedModules;
|
LIST_ENTRY BlpLoadedModules;
|
||||||
|
|
||||||
/* XT Boot Loader menu list */
|
/* XT Boot Loader menu list */
|
||||||
PLIST_ENTRY BlpMenuList = NULL;
|
PLIST_ENTRY BlpMenuList = NULLPTR;
|
||||||
|
|
||||||
/* XT Boot Loader status data */
|
/* XT Boot Loader status data */
|
||||||
XTBL_STATUS BlpStatus = {0};
|
XTBL_STATUS BlpStatus = {0};
|
||||||
|
@@ -24,7 +24,7 @@ BlpActivateSerialIOController()
|
|||||||
PEFI_PCI_ROOT_BRIDGE_IO_PROTOCOL PciDev;
|
PEFI_PCI_ROOT_BRIDGE_IO_PROTOCOL PciDev;
|
||||||
USHORT Bus, Device, Function, Command;
|
USHORT Bus, Device, Function, Command;
|
||||||
UINT_PTR Index, PciHandleSize;
|
UINT_PTR Index, PciHandleSize;
|
||||||
PEFI_HANDLE PciHandle = NULL;
|
PEFI_HANDLE PciHandle = NULLPTR;
|
||||||
PCI_COMMON_HEADER PciHeader;
|
PCI_COMMON_HEADER PciHeader;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
ULONGLONG Address;
|
ULONGLONG Address;
|
||||||
@@ -39,7 +39,7 @@ BlpActivateSerialIOController()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get all instances of PciRootBridgeIo */
|
/* Get all instances of PciRootBridgeIo */
|
||||||
Status = EfiSystemTable->BootServices->LocateHandle(ByProtocol, &PciGuid, NULL, &PciHandleSize, PciHandle);
|
Status = EfiSystemTable->BootServices->LocateHandle(ByProtocol, &PciGuid, NULLPTR, &PciHandleSize, PciHandle);
|
||||||
if(Status == STATUS_EFI_BUFFER_TOO_SMALL)
|
if(Status == STATUS_EFI_BUFFER_TOO_SMALL)
|
||||||
{
|
{
|
||||||
/* Reallocate more memory as requested by UEFI */
|
/* Reallocate more memory as requested by UEFI */
|
||||||
@@ -52,7 +52,7 @@ BlpActivateSerialIOController()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Second attempt to get instances of PciRootBridgeIo */
|
/* Second attempt to get instances of PciRootBridgeIo */
|
||||||
Status = EfiSystemTable->BootServices->LocateHandle(ByProtocol, &PciGuid, NULL, &PciHandleSize, PciHandle);
|
Status = EfiSystemTable->BootServices->LocateHandle(ByProtocol, &PciGuid, NULLPTR, &PciHandleSize, PciHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure successfully obtained PciRootBridgeIo instances */
|
/* Make sure successfully obtained PciRootBridgeIo instances */
|
||||||
|
@@ -32,13 +32,13 @@ BlGetXtLdrProtocol(IN PEFI_SYSTEM_TABLE SystemTable,
|
|||||||
OUT PXTBL_LOADER_PROTOCOL *ProtocolHandler)
|
OUT PXTBL_LOADER_PROTOCOL *ProtocolHandler)
|
||||||
{
|
{
|
||||||
EFI_GUID ProtocolGuid = XT_BOOT_LOADER_PROTOCOL_GUID;
|
EFI_GUID ProtocolGuid = XT_BOOT_LOADER_PROTOCOL_GUID;
|
||||||
PEFI_HANDLE Handles = NULL;
|
PEFI_HANDLE Handles = NULLPTR;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT_PTR Count;
|
UINT_PTR Count;
|
||||||
UINT Index;
|
UINT Index;
|
||||||
|
|
||||||
/* Try to locate the handles */
|
/* Try to locate the handles */
|
||||||
Status = SystemTable->BootServices->LocateHandleBuffer(ByProtocol, &ProtocolGuid, NULL, &Count, &Handles);
|
Status = SystemTable->BootServices->LocateHandleBuffer(ByProtocol, &ProtocolGuid, NULLPTR, &Count, &Handles);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Unable to get handles */
|
/* Unable to get handles */
|
||||||
@@ -53,7 +53,7 @@ BlGetXtLdrProtocol(IN PEFI_SYSTEM_TABLE SystemTable,
|
|||||||
{
|
{
|
||||||
/* Try to open protocol */
|
/* Try to open protocol */
|
||||||
Status = SystemTable->BootServices->OpenProtocol(Handles[Index], &ProtocolGuid,
|
Status = SystemTable->BootServices->OpenProtocol(Handles[Index], &ProtocolGuid,
|
||||||
(PVOID*)ProtocolHandler, ImageHandle, NULL,
|
(PVOID*)ProtocolHandler, ImageHandle, NULLPTR,
|
||||||
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
||||||
|
|
||||||
/* Check if successfully opened the loader protocol */
|
/* Check if successfully opened the loader protocol */
|
||||||
@@ -69,7 +69,7 @@ BlGetXtLdrProtocol(IN PEFI_SYSTEM_TABLE SystemTable,
|
|||||||
SystemTable->BootServices->FreePool(Handles);
|
SystemTable->BootServices->FreePool(Handles);
|
||||||
|
|
||||||
/* Make sure the loaded protocol has been found */
|
/* Make sure the loaded protocol has been found */
|
||||||
if(*ProtocolHandler == NULL)
|
if(*ProtocolHandler == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Protocol not found */
|
/* Protocol not found */
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
|
@@ -130,12 +130,12 @@ BlGetMemoryMap(OUT PEFI_MEMORY_MAP MemoryMap)
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
if(MemoryMap == NULL)
|
if(MemoryMap == NULLPTR)
|
||||||
{
|
{
|
||||||
return STATUS_EFI_INVALID_PARAMETER;
|
return STATUS_EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryMap->Map = NULL;
|
MemoryMap->Map = NULLPTR;
|
||||||
MemoryMap->MapSize = 0;
|
MemoryMap->MapSize = 0;
|
||||||
|
|
||||||
/* Get memory map */
|
/* Get memory map */
|
||||||
@@ -167,7 +167,7 @@ BlGetMemoryMap(OUT PEFI_MEMORY_MAP MemoryMap)
|
|||||||
while(Status == STATUS_EFI_BUFFER_TOO_SMALL);
|
while(Status == STATUS_EFI_BUFFER_TOO_SMALL);
|
||||||
|
|
||||||
/* Make sure memory map is set */
|
/* Make sure memory map is set */
|
||||||
if(MemoryMap->Map == NULL)
|
if(MemoryMap->Map == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Something went wrong */
|
/* Something went wrong */
|
||||||
return STATUS_EFI_NO_MAPPING;
|
return STATUS_EFI_NO_MAPPING;
|
||||||
@@ -290,7 +290,7 @@ BlMapEfiMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
|||||||
VirtualAddress = *MemoryMapAddress;
|
VirtualAddress = *MemoryMapAddress;
|
||||||
|
|
||||||
/* Check if custom memory type routine is specified */
|
/* Check if custom memory type routine is specified */
|
||||||
if(GetMemoryTypeRoutine == NULL)
|
if(GetMemoryTypeRoutine == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Use default memory type routine */
|
/* Use default memory type routine */
|
||||||
GetMemoryTypeRoutine = BlpGetLoaderMemoryType;
|
GetMemoryTypeRoutine = BlpGetLoaderMemoryType;
|
||||||
@@ -367,7 +367,7 @@ BlMapEfiMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Map all other memory as loader free */
|
/* Map all other memory as loader free */
|
||||||
Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)Descriptor->PhysicalStart,
|
Status = BlMapVirtualMemory(PageMap, NULLPTR, (PVOID)Descriptor->PhysicalStart,
|
||||||
Descriptor->NumberOfPages, LoaderFree);
|
Descriptor->NumberOfPages, LoaderFree);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ BlMapEfiMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Always map first page */
|
/* Always map first page */
|
||||||
Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)0, 1, LoaderFirmwarePermanent);
|
Status = BlMapVirtualMemory(PageMap, NULLPTR, (PVOID)0, 1, LoaderFirmwarePermanent);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Mapping failed */
|
/* Mapping failed */
|
||||||
@@ -392,7 +392,7 @@ BlMapEfiMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Map BIOS ROM and VRAM */
|
/* Map BIOS ROM and VRAM */
|
||||||
Status = BlMapVirtualMemory(PageMap, NULL, (PVOID)0xA0000, 0x60, LoaderFirmwarePermanent);
|
Status = BlMapVirtualMemory(PageMap, NULLPTR, (PVOID)0xA0000, 0x60, LoaderFirmwarePermanent);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Mapping failed */
|
/* Mapping failed */
|
||||||
@@ -500,7 +500,7 @@ BlMapVirtualMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
|||||||
|
|
||||||
/* Set mapping fields and insert it on the top */
|
/* Set mapping fields and insert it on the top */
|
||||||
Mapping3->PhysicalAddress = (PUCHAR)PhysicalAddressEnd + 1;
|
Mapping3->PhysicalAddress = (PUCHAR)PhysicalAddressEnd + 1;
|
||||||
Mapping3->VirtualAddress = NULL;
|
Mapping3->VirtualAddress = NULLPTR;
|
||||||
Mapping3->NumberOfPages = NumberOfMappedPages;
|
Mapping3->NumberOfPages = NumberOfMappedPages;
|
||||||
Mapping3->MemoryType = Mapping2->MemoryType;
|
Mapping3->MemoryType = Mapping2->MemoryType;
|
||||||
RtlInsertHeadList(&Mapping2->ListEntry, &Mapping3->ListEntry);
|
RtlInsertHeadList(&Mapping2->ListEntry, &Mapping3->ListEntry);
|
||||||
@@ -536,7 +536,7 @@ BlMapVirtualMemory(IN OUT PXTBL_PAGE_MAPPING PageMap,
|
|||||||
|
|
||||||
/* Set mapping fields and insert it on the top */
|
/* Set mapping fields and insert it on the top */
|
||||||
Mapping3->PhysicalAddress = Mapping1->PhysicalAddress;
|
Mapping3->PhysicalAddress = Mapping1->PhysicalAddress;
|
||||||
Mapping3->VirtualAddress = NULL;
|
Mapping3->VirtualAddress = NULLPTR;
|
||||||
Mapping3->NumberOfPages = NumberOfMappedPages;
|
Mapping3->NumberOfPages = NumberOfMappedPages;
|
||||||
Mapping3->MemoryType = Mapping2->MemoryType;
|
Mapping3->MemoryType = Mapping2->MemoryType;
|
||||||
RtlInsertHeadList(&Mapping2->ListEntry, &Mapping3->ListEntry);
|
RtlInsertHeadList(&Mapping2->ListEntry, &Mapping3->ListEntry);
|
||||||
|
@@ -61,7 +61,7 @@ AcGetAcpiDescriptionPointer(OUT PVOID *AcpiTable)
|
|||||||
* Supplies a pointer to the table to start searching from.
|
* Supplies a pointer to the table to start searching from.
|
||||||
*
|
*
|
||||||
* @param AcpiTable
|
* @param AcpiTable
|
||||||
* Supplies a pointer to memory area where ACPI table address will be stored, or NULL if not found.
|
* Supplies a pointer to memory area where ACPI table address will be stored, or NULLPTR if not found.
|
||||||
*
|
*
|
||||||
* @return This routine returns a status code.
|
* @return This routine returns a status code.
|
||||||
*
|
*
|
||||||
@@ -81,8 +81,8 @@ AcGetAcpiTable(IN CONST UINT Signature,
|
|||||||
PACPI_RSDT Rsdt;
|
PACPI_RSDT Rsdt;
|
||||||
BOOLEAN Xsdp;
|
BOOLEAN Xsdp;
|
||||||
|
|
||||||
/* Return NULL address by default if requested table not found */
|
/* Return NULLPTR by default if requested table not found */
|
||||||
*AcpiTable = NULL;
|
*AcpiTable = NULLPTR;
|
||||||
|
|
||||||
/* Get Root System Description Table Pointer */
|
/* Get Root System Description Table Pointer */
|
||||||
Status = AcGetAcpiDescriptionPointer((PVOID)&Rsdp);
|
Status = AcGetAcpiDescriptionPointer((PVOID)&Rsdp);
|
||||||
@@ -127,13 +127,13 @@ AcGetAcpiTable(IN CONST UINT Signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if previous table provided */
|
/* Check if previous table provided */
|
||||||
if(PreviousTable != NULL)
|
if(PreviousTable != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Check if this is a table previously found */
|
/* Check if this is a table previously found */
|
||||||
if(TableHeader == (PVOID)PreviousTable)
|
if(TableHeader == (PVOID)PreviousTable)
|
||||||
{
|
{
|
||||||
/* Unset previous table */
|
/* Unset previous table */
|
||||||
PreviousTable = NULL;
|
PreviousTable = NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip to next ACPI table */
|
/* Skip to next ACPI table */
|
||||||
@@ -231,7 +231,7 @@ AcGetRsdpTable(OUT PVOID *AcpiTable)
|
|||||||
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(RsdpTable, 20))
|
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(RsdpTable, 20))
|
||||||
{
|
{
|
||||||
/* RSDP not found or checksum mismatch */
|
/* RSDP not found or checksum mismatch */
|
||||||
*AcpiTable = NULL;
|
*AcpiTable = NULLPTR;
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ AcGetSMBiosTable(OUT PVOID *SmBiosTable)
|
|||||||
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(SmBios, SmBios->Length))
|
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(SmBios, SmBios->Length))
|
||||||
{
|
{
|
||||||
/* SMBIOS not found or checksum mismatch */
|
/* SMBIOS not found or checksum mismatch */
|
||||||
*SmBiosTable = NULL;
|
*SmBiosTable = NULLPTR;
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ AcGetSMBios3Table(OUT PVOID *SmBiosTable)
|
|||||||
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(SmBios, SmBios->Length))
|
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(SmBios, SmBios->Length))
|
||||||
{
|
{
|
||||||
/* SMBIOS3 not found or checksum mismatch */
|
/* SMBIOS3 not found or checksum mismatch */
|
||||||
*SmBiosTable = NULL;
|
*SmBiosTable = NULLPTR;
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ AcGetXsdpTable(OUT PVOID *AcpiTable)
|
|||||||
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(XsdpTable, 36))
|
if(Status != STATUS_EFI_SUCCESS || !AcpValidateAcpiTable(XsdpTable, 36))
|
||||||
{
|
{
|
||||||
/* XSDP not found or checksum mismatch */
|
/* XSDP not found or checksum mismatch */
|
||||||
*AcpiTable = NULL;
|
*AcpiTable = NULLPTR;
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ BpPlayTune(IN PWCHAR Arguments)
|
|||||||
Argument = RtlTokenizeWideString(Arguments, L" ", &LastArgument);
|
Argument = RtlTokenizeWideString(Arguments, L" ", &LastArgument);
|
||||||
|
|
||||||
/* Iterate over all arguments */
|
/* Iterate over all arguments */
|
||||||
while(Argument != NULL)
|
while(Argument != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Check if tempo, pitch and duration are set */
|
/* Check if tempo, pitch and duration are set */
|
||||||
if(Tempo < 0)
|
if(Tempo < 0)
|
||||||
@@ -137,7 +137,7 @@ BpPlayTune(IN PWCHAR Arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get next argument */
|
/* Get next argument */
|
||||||
Argument = RtlTokenizeWideString(NULL, L" ", &LastArgument);
|
Argument = RtlTokenizeWideString(NULLPTR, L" ", &LastArgument);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stop emitting beep tone */
|
/* Stop emitting beep tone */
|
||||||
|
@@ -39,7 +39,7 @@ ChBootSystem(IN PXTBL_BOOT_PARAMETERS Parameters)
|
|||||||
PVOID LoaderData;
|
PVOID LoaderData;
|
||||||
|
|
||||||
/* Check if image file is provided */
|
/* Check if image file is provided */
|
||||||
if(Parameters->KernelFile == NULL)
|
if(Parameters->KernelFile == NULLPTR)
|
||||||
{
|
{
|
||||||
/* No image filename provided, return error code */
|
/* No image filename provided, return error code */
|
||||||
XtLdrProtocol->Debug.Print(L"ERROR: No EFI image filename provided\n");
|
XtLdrProtocol->Debug.Print(L"ERROR: No EFI image filename provided\n");
|
||||||
|
@@ -185,7 +185,7 @@ FbInitializeDisplay()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Query current graphics mode */
|
/* Query current graphics mode */
|
||||||
QueryMode = FbpDisplayInfo.Driver.Gop->Mode == NULL ? 0 : FbpDisplayInfo.Driver.Gop->Mode->Mode;
|
QueryMode = FbpDisplayInfo.Driver.Gop->Mode == NULLPTR ? 0 : FbpDisplayInfo.Driver.Gop->Mode->Mode;
|
||||||
Status = FbpDisplayInfo.Driver.Gop->QueryMode(FbpDisplayInfo.Driver.Gop, QueryMode, &InfoSize, &GopModeInfo);
|
Status = FbpDisplayInfo.Driver.Gop->QueryMode(FbpDisplayInfo.Driver.Gop, QueryMode, &InfoSize, &GopModeInfo);
|
||||||
if(Status == STATUS_EFI_NOT_STARTED)
|
if(Status == STATUS_EFI_NOT_STARTED)
|
||||||
{
|
{
|
||||||
@@ -357,7 +357,7 @@ FbSetScreenResolution(IN UINT Width,
|
|||||||
{
|
{
|
||||||
/* Get mode information */
|
/* Get mode information */
|
||||||
Status = FbpDisplayInfo.Driver.Gop->QueryMode(FbpDisplayInfo.Driver.Gop, Mode, &Size, &ModeInfo);
|
Status = FbpDisplayInfo.Driver.Gop->QueryMode(FbpDisplayInfo.Driver.Gop, Mode, &Size, &ModeInfo);
|
||||||
if(Status == STATUS_EFI_SUCCESS && Size >= sizeof(*ModeInfo) && ModeInfo != NULL)
|
if(Status == STATUS_EFI_SUCCESS && Size >= sizeof(*ModeInfo) && ModeInfo != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Check if match found */
|
/* Check if match found */
|
||||||
if(ModeInfo->HorizontalResolution == Width && ModeInfo->VerticalResolution == Height)
|
if(ModeInfo->HorizontalResolution == Width && ModeInfo->VerticalResolution == Height)
|
||||||
@@ -441,7 +441,7 @@ FbpFindFramebufferAddress(OUT PEFI_PHYSICAL_ADDRESS Address)
|
|||||||
|
|
||||||
/* Initialize variables */
|
/* Initialize variables */
|
||||||
FramebufAddressLength = 0;
|
FramebufAddressLength = 0;
|
||||||
Handles = NULL;
|
Handles = NULLPTR;
|
||||||
|
|
||||||
/* Locate EFI_PCI_IO_PROTOCOL handles */
|
/* Locate EFI_PCI_IO_PROTOCOL handles */
|
||||||
Status = XtLdrProtocol->Protocol.LocateHandles(&Handles, &HandlesCount, &PciIoGuid);
|
Status = XtLdrProtocol->Protocol.LocateHandles(&Handles, &HandlesCount, &PciIoGuid);
|
||||||
@@ -488,7 +488,7 @@ FbpFindFramebufferAddress(OUT PEFI_PHYSICAL_ADDRESS Address)
|
|||||||
for(UINT Bars = 0; Bars < 6; Bars++)
|
for(UINT Bars = 0; Bars < 6; Bars++)
|
||||||
{
|
{
|
||||||
/* Get BAR attributes */
|
/* Get BAR attributes */
|
||||||
Status = IoProtocol->GetBarAttributes(IoProtocol, Bars, NULL, (VOID **)&BarInfo);
|
Status = IoProtocol->GetBarAttributes(IoProtocol, Bars, NULLPTR, (VOID **)&BarInfo);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to get BAR attributes, continue with next BAR */
|
/* Failed to get BAR attributes, continue with next BAR */
|
||||||
|
@@ -400,7 +400,7 @@ PeLoadImage(IN PEFI_FILE_HANDLE FileHandle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Store file size and memory type, nullify data and free up memory */
|
/* Store file size and memory type, nullify data and free up memory */
|
||||||
ImageData->Data = NULL;
|
ImageData->Data = NULLPTR;
|
||||||
ImageData->FileSize = FileInfo->FileSize;
|
ImageData->FileSize = FileInfo->FileSize;
|
||||||
ImageData->MemoryType = MemoryType;
|
ImageData->MemoryType = MemoryType;
|
||||||
XtLdrProtocol->Memory.FreePool(FileInfo);
|
XtLdrProtocol->Memory.FreePool(FileInfo);
|
||||||
|
@@ -260,7 +260,7 @@ XtBootSystem(IN PXTBL_BOOT_PARAMETERS Parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check device path */
|
/* Check device path */
|
||||||
if(Parameters->DevicePath == NULL)
|
if(Parameters->DevicePath == NULLPTR)
|
||||||
{
|
{
|
||||||
/* No device path set */
|
/* No device path set */
|
||||||
XtLdrProtocol->Debug.Print(L"ERROR: No device path provided, unable to boot system\n");
|
XtLdrProtocol->Debug.Print(L"ERROR: No device path provided, unable to boot system\n");
|
||||||
@@ -268,7 +268,7 @@ XtBootSystem(IN PXTBL_BOOT_PARAMETERS Parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if system path is set */
|
/* Check if system path is set */
|
||||||
if(Parameters->SystemPath != NULL)
|
if(Parameters->SystemPath != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Make sure system path begins with backslash, the only separator supported by EFI */
|
/* Make sure system path begins with backslash, the only separator supported by EFI */
|
||||||
if(Parameters->SystemPath[0] == '/')
|
if(Parameters->SystemPath[0] == '/')
|
||||||
@@ -300,7 +300,7 @@ XtBootSystem(IN PXTBL_BOOT_PARAMETERS Parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if kernel file is set */
|
/* Check if kernel file is set */
|
||||||
if(Parameters->KernelFile == NULL)
|
if(Parameters->KernelFile == NULLPTR)
|
||||||
{
|
{
|
||||||
/* No kernel filename set, fallback to default */
|
/* No kernel filename set, fallback to default */
|
||||||
XtLdrProtocol->Debug.Print(L"WARNING: No kernel file specified, falling back to defaults\n");
|
XtLdrProtocol->Debug.Print(L"WARNING: No kernel file specified, falling back to defaults\n");
|
||||||
@@ -308,7 +308,7 @@ XtBootSystem(IN PXTBL_BOOT_PARAMETERS Parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if provided any kernel boot arguments */
|
/* Check if provided any kernel boot arguments */
|
||||||
if(Parameters->Parameters == NULL)
|
if(Parameters->Parameters == NULLPTR)
|
||||||
{
|
{
|
||||||
/* No argument supplied */
|
/* No argument supplied */
|
||||||
Parameters->Parameters = L"";
|
Parameters->Parameters = L"";
|
||||||
@@ -382,7 +382,7 @@ XtpBootSequence(IN PEFI_FILE_HANDLE BootDir,
|
|||||||
EFI_GUID FrameBufGuid = XT_FRAMEBUFFER_PROTOCOL_GUID;
|
EFI_GUID FrameBufGuid = XT_FRAMEBUFFER_PROTOCOL_GUID;
|
||||||
PKERNEL_INITIALIZATION_BLOCK KernelParameters;
|
PKERNEL_INITIALIZATION_BLOCK KernelParameters;
|
||||||
PXTBL_FRAMEBUFFER_PROTOCOL FrameBufProtocol;
|
PXTBL_FRAMEBUFFER_PROTOCOL FrameBufProtocol;
|
||||||
PPECOFF_IMAGE_CONTEXT ImageContext = NULL;
|
PPECOFF_IMAGE_CONTEXT ImageContext = NULLPTR;
|
||||||
PEFI_LOADED_IMAGE_PROTOCOL ImageProtocol;
|
PEFI_LOADED_IMAGE_PROTOCOL ImageProtocol;
|
||||||
PVOID VirtualAddress, VirtualMemoryArea;
|
PVOID VirtualAddress, VirtualMemoryArea;
|
||||||
PXT_ENTRY_POINT KernelEntryPoint;
|
PXT_ENTRY_POINT KernelEntryPoint;
|
||||||
@@ -412,7 +412,7 @@ XtpBootSequence(IN PEFI_FILE_HANDLE BootDir,
|
|||||||
/* Initialize virtual memory mappings */
|
/* Initialize virtual memory mappings */
|
||||||
XtLdrProtocol->Memory.InitializePageMap(&PageMap, XtpDeterminePagingLevel(Parameters->Parameters), Size4K);
|
XtLdrProtocol->Memory.InitializePageMap(&PageMap, XtpDeterminePagingLevel(Parameters->Parameters), Size4K);
|
||||||
|
|
||||||
Status = XtLdrProtocol->Memory.MapEfiMemory(&PageMap, &VirtualMemoryArea, NULL);
|
Status = XtLdrProtocol->Memory.MapEfiMemory(&PageMap, &VirtualMemoryArea, NULLPTR);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
return Status;
|
return Status;
|
||||||
@@ -582,7 +582,7 @@ XtpInitializeLoaderBlock(IN PXTBL_PAGE_MAPPING PageMap,
|
|||||||
/* Set FirmwareInformation block properties */
|
/* Set FirmwareInformation block properties */
|
||||||
LoaderBlock->FirmwareInformation.FirmwareType = SystemFirmwareEfi;
|
LoaderBlock->FirmwareInformation.FirmwareType = SystemFirmwareEfi;
|
||||||
LoaderBlock->FirmwareInformation.EfiFirmware.EfiVersion = 0; //EfiSystemTable->Hdr.Revision;
|
LoaderBlock->FirmwareInformation.EfiFirmware.EfiVersion = 0; //EfiSystemTable->Hdr.Revision;
|
||||||
LoaderBlock->FirmwareInformation.EfiFirmware.EfiRuntimeServices = NULL;
|
LoaderBlock->FirmwareInformation.EfiFirmware.EfiRuntimeServices = NULLPTR;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
|
@@ -27,7 +27,7 @@ EFI_STATUS
|
|||||||
BlCloseProtocol(IN PEFI_HANDLE Handle,
|
BlCloseProtocol(IN PEFI_HANDLE Handle,
|
||||||
IN PEFI_GUID ProtocolGuid)
|
IN PEFI_GUID ProtocolGuid)
|
||||||
{
|
{
|
||||||
return EfiSystemTable->BootServices->CloseProtocol(Handle, ProtocolGuid, EfiImageHandle, NULL);
|
return EfiSystemTable->BootServices->CloseProtocol(Handle, ProtocolGuid, EfiImageHandle, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,7 +97,7 @@ BlGetModulesList()
|
|||||||
* Specifies a unique protocol GUID.
|
* Specifies a unique protocol GUID.
|
||||||
*
|
*
|
||||||
* @param Interface
|
* @param Interface
|
||||||
* Supplies a pointer to the protocol interface, or NULL if there is no structure associated.
|
* Supplies a pointer to the protocol interface, or NULLPTR if there is no structure associated.
|
||||||
*
|
*
|
||||||
* @return This routine returns a status code.
|
* @return This routine returns a status code.
|
||||||
*
|
*
|
||||||
@@ -108,7 +108,7 @@ EFI_STATUS
|
|||||||
BlInstallProtocol(IN PVOID Interface,
|
BlInstallProtocol(IN PVOID Interface,
|
||||||
IN PEFI_GUID Guid)
|
IN PEFI_GUID Guid)
|
||||||
{
|
{
|
||||||
EFI_HANDLE Handle = NULL;
|
EFI_HANDLE Handle = NULLPTR;
|
||||||
|
|
||||||
/* Install protocol interface */
|
/* Install protocol interface */
|
||||||
return EfiSystemTable->BootServices->InstallProtocolInterface(&Handle, Guid, EFI_NATIVE_INTERFACE, Interface);
|
return EfiSystemTable->BootServices->InstallProtocolInterface(&Handle, Guid, EFI_NATIVE_INTERFACE, Interface);
|
||||||
@@ -171,7 +171,7 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
RtlConcatenateWideString(ModuleFileName, L".EFI", 0);
|
RtlConcatenateWideString(ModuleFileName, L".EFI", 0);
|
||||||
|
|
||||||
/* Open EFI volume */
|
/* Open EFI volume */
|
||||||
Status = BlOpenVolume(NULL, &DiskHandle, &FsHandle);
|
Status = BlOpenVolume(NULLPTR, &DiskHandle, &FsHandle);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to open a volume */
|
/* Failed to open a volume */
|
||||||
@@ -264,7 +264,7 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
ModuleDependency = CONTAIN_RECORD(DepsListEntry, XTBL_MODULE_DEPS, Flink);
|
ModuleDependency = CONTAIN_RECORD(DepsListEntry, XTBL_MODULE_DEPS, Flink);
|
||||||
|
|
||||||
/* Make sure dependency list contains a valid module name */
|
/* Make sure dependency list contains a valid module name */
|
||||||
if(ModuleDependency->ModuleName == NULL || ModuleDependency->ModuleName[0] == L'\0')
|
if(ModuleDependency->ModuleName == NULLPTR || ModuleDependency->ModuleName[0] == L'\0')
|
||||||
{
|
{
|
||||||
/* Invalid module name found, just skip this step */
|
/* Invalid module name found, just skip this step */
|
||||||
break;
|
break;
|
||||||
@@ -320,7 +320,7 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
|
|
||||||
/* Access module interface for further module type check */
|
/* Access module interface for further module type check */
|
||||||
Status = EfiSystemTable->BootServices->OpenProtocol(ModuleHandle, &LIPGuid, (PVOID *)&LoadedImage,
|
Status = EfiSystemTable->BootServices->OpenProtocol(ModuleHandle, &LIPGuid, (PVOID *)&LoadedImage,
|
||||||
EfiImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
|
EfiImageHandle, NULLPTR, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to open LoadedImage protocol */
|
/* Failed to open LoadedImage protocol */
|
||||||
@@ -335,7 +335,7 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
BlDebugPrint(L"ERROR: Loaded module is not a boot system driver\n");
|
BlDebugPrint(L"ERROR: Loaded module is not a boot system driver\n");
|
||||||
|
|
||||||
/* Close protocol and skip module */
|
/* Close protocol and skip module */
|
||||||
EfiSystemTable->BootServices->CloseProtocol(LoadedImage, &LIPGuid, LoadedImage, NULL);
|
EfiSystemTable->BootServices->CloseProtocol(LoadedImage, &LIPGuid, LoadedImage, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save additional module information, not found in '.modinfo' section */
|
/* Save additional module information, not found in '.modinfo' section */
|
||||||
@@ -346,7 +346,7 @@ BlLoadModule(IN PWCHAR ModuleName)
|
|||||||
ModuleInfo->UnloadModule = LoadedImage->Unload;
|
ModuleInfo->UnloadModule = LoadedImage->Unload;
|
||||||
|
|
||||||
/* Close loaded image protocol */
|
/* Close loaded image protocol */
|
||||||
EfiSystemTable->BootServices->CloseProtocol(LoadedImage, &LIPGuid, LoadedImage, NULL);
|
EfiSystemTable->BootServices->CloseProtocol(LoadedImage, &LIPGuid, LoadedImage, NULLPTR);
|
||||||
|
|
||||||
/* Start EFI image */
|
/* Start EFI image */
|
||||||
Status = BlStartEfiImage(ModuleHandle);
|
Status = BlStartEfiImage(ModuleHandle);
|
||||||
@@ -384,13 +384,13 @@ BlLoadModules(IN PWCHAR ModulesList)
|
|||||||
/* Set default return value */
|
/* Set default return value */
|
||||||
ReturnStatus = STATUS_EFI_SUCCESS;
|
ReturnStatus = STATUS_EFI_SUCCESS;
|
||||||
|
|
||||||
if(ModulesList != NULL)
|
if(ModulesList != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Tokenize provided list of modules */
|
/* Tokenize provided list of modules */
|
||||||
Module = RtlTokenizeWideString(ModulesList, L" ", &LastModule);
|
Module = RtlTokenizeWideString(ModulesList, L" ", &LastModule);
|
||||||
|
|
||||||
/* Iterate over all arguments passed to boot loader */
|
/* Iterate over all arguments passed to boot loader */
|
||||||
while(Module != NULL)
|
while(Module != NULLPTR)
|
||||||
{
|
{
|
||||||
Status = BlLoadModule(Module);
|
Status = BlLoadModule(Module);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
@@ -401,7 +401,7 @@ BlLoadModules(IN PWCHAR ModulesList)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Take next module from the list */
|
/* Take next module from the list */
|
||||||
Module = RtlTokenizeWideString(NULL, L" ", &LastModule);
|
Module = RtlTokenizeWideString(NULLPTR, L" ", &LastModule);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ BlLocateProtocolHandles(OUT PEFI_HANDLE *Handles,
|
|||||||
OUT PUINT_PTR Count,
|
OUT PUINT_PTR Count,
|
||||||
IN PEFI_GUID ProtocolGuid)
|
IN PEFI_GUID ProtocolGuid)
|
||||||
{
|
{
|
||||||
return EfiSystemTable->BootServices->LocateHandleBuffer(ByProtocol, ProtocolGuid, NULL, Count, Handles);
|
return EfiSystemTable->BootServices->LocateHandleBuffer(ByProtocol, ProtocolGuid, NULLPTR, Count, Handles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -456,7 +456,7 @@ BlOpenProtocol(OUT PEFI_HANDLE Handle,
|
|||||||
OUT PVOID *ProtocolHandler,
|
OUT PVOID *ProtocolHandler,
|
||||||
IN PEFI_GUID ProtocolGuid)
|
IN PEFI_GUID ProtocolGuid)
|
||||||
{
|
{
|
||||||
PEFI_HANDLE Handles = NULL;
|
PEFI_HANDLE Handles = NULLPTR;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT_PTR Count;
|
UINT_PTR Count;
|
||||||
UINT Index;
|
UINT Index;
|
||||||
@@ -492,7 +492,7 @@ BlOpenProtocol(OUT PEFI_HANDLE Handle,
|
|||||||
EfiSystemTable->BootServices->FreePool(Handles);
|
EfiSystemTable->BootServices->FreePool(Handles);
|
||||||
|
|
||||||
/* Make sure the loaded protocol has been found */
|
/* Make sure the loaded protocol has been found */
|
||||||
if(*ProtocolHandler == NULL)
|
if(*ProtocolHandler == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Protocol not found */
|
/* Protocol not found */
|
||||||
return STATUS_EFI_NOT_FOUND;
|
return STATUS_EFI_NOT_FOUND;
|
||||||
@@ -525,7 +525,7 @@ BlOpenProtocolHandle(IN EFI_HANDLE Handle,
|
|||||||
IN PEFI_GUID ProtocolGuid)
|
IN PEFI_GUID ProtocolGuid)
|
||||||
{
|
{
|
||||||
return EfiSystemTable->BootServices->OpenProtocol(Handle, ProtocolGuid, ProtocolHandler, EfiImageHandle,
|
return EfiSystemTable->BootServices->OpenProtocol(Handle, ProtocolGuid, ProtocolHandler, EfiImageHandle,
|
||||||
NULL, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
NULLPTR, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -689,7 +689,7 @@ BlpGetModuleInformation(IN PWCHAR SectionData,
|
|||||||
{
|
{
|
||||||
/* Tokenize value to get module's single dependency */
|
/* Tokenize value to get module's single dependency */
|
||||||
Dependency = RtlTokenizeWideString(Strings[Index], L" ", &LastStr);
|
Dependency = RtlTokenizeWideString(Strings[Index], L" ", &LastStr);
|
||||||
while(Dependency != NULL)
|
while(Dependency != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Allocate memory for module dependency */
|
/* Allocate memory for module dependency */
|
||||||
Status = BlAllocateMemoryPool(sizeof(XTBL_MODULE_DEPS), (PVOID*)&ModuleDependencies);
|
Status = BlAllocateMemoryPool(sizeof(XTBL_MODULE_DEPS), (PVOID*)&ModuleDependencies);
|
||||||
@@ -704,7 +704,7 @@ BlpGetModuleInformation(IN PWCHAR SectionData,
|
|||||||
RtlInsertTailList(&ModuleInfo->Dependencies, &ModuleDependencies->Flink);
|
RtlInsertTailList(&ModuleInfo->Dependencies, &ModuleDependencies->Flink);
|
||||||
|
|
||||||
/* Get next dependency from single value if available */
|
/* Get next dependency from single value if available */
|
||||||
Dependency = RtlTokenizeWideString(NULL, L" ", &LastStr);
|
Dependency = RtlTokenizeWideString(NULLPTR, L" ", &LastStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(RtlCompareWideString(Key, L"version", 7) == 0)
|
else if(RtlCompareWideString(Key, L"version", 7) == 0)
|
||||||
@@ -756,7 +756,7 @@ BlpGetModuleInfoStrings(IN PWCHAR SectionData,
|
|||||||
if(!InfoStrings || !SectionSize)
|
if(!InfoStrings || !SectionSize)
|
||||||
{
|
{
|
||||||
/* Invalid input parameters */
|
/* Invalid input parameters */
|
||||||
*ModInfo = NULL;
|
*ModInfo = NULLPTR;
|
||||||
*InfoCount = 0;
|
*InfoCount = 0;
|
||||||
return STATUS_EFI_INVALID_PARAMETER;
|
return STATUS_EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@@ -775,7 +775,7 @@ BlpGetModuleInfoStrings(IN PWCHAR SectionData,
|
|||||||
if(DataSize < 1)
|
if(DataSize < 1)
|
||||||
{
|
{
|
||||||
/* No strings found */
|
/* No strings found */
|
||||||
*ModInfo = NULL;
|
*ModInfo = NULLPTR;
|
||||||
*InfoCount = 0;
|
*InfoCount = 0;
|
||||||
return STATUS_EFI_END_OF_FILE;
|
return STATUS_EFI_END_OF_FILE;
|
||||||
}
|
}
|
||||||
@@ -793,7 +793,7 @@ BlpGetModuleInfoStrings(IN PWCHAR SectionData,
|
|||||||
{
|
{
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
/* Skip all null terminators */
|
/* Skip all NULL terminators */
|
||||||
while(Index < DataSize && InfoStrings[Index] == L'\0')
|
while(Index < DataSize && InfoStrings[Index] == L'\0')
|
||||||
{
|
{
|
||||||
Index++;
|
Index++;
|
||||||
@@ -814,11 +814,11 @@ BlpGetModuleInfoStrings(IN PWCHAR SectionData,
|
|||||||
/* Copy the raw string data */
|
/* Copy the raw string data */
|
||||||
RtlCopyMemory(String, InfoStrings, DataSize * sizeof(WCHAR));
|
RtlCopyMemory(String, InfoStrings, DataSize * sizeof(WCHAR));
|
||||||
|
|
||||||
/* Ensure the entire buffer is null-terminated for safety */
|
/* Ensure the entire buffer is NULL-terminated for safety */
|
||||||
String[DataSize] = L'\0';
|
String[DataSize] = L'\0';
|
||||||
|
|
||||||
/* Set the last element of the pointer array to NULL */
|
/* Set the last element of the pointer array to NULLPTR */
|
||||||
Array[Count] = NULL;
|
Array[Count] = NULLPTR;
|
||||||
|
|
||||||
/* Populate the array with pointers to the strings within the buffer */
|
/* Populate the array with pointers to the strings within the buffer */
|
||||||
Index = 0;
|
Index = 0;
|
||||||
@@ -834,7 +834,7 @@ BlpGetModuleInfoStrings(IN PWCHAR SectionData,
|
|||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip all null terminators to find the beginning of the next string */
|
/* Skip all NULL terminators to find the beginning of the next string */
|
||||||
while(Index < DataSize && String[Index] == L'\0')
|
while(Index < DataSize && String[Index] == L'\0')
|
||||||
{
|
{
|
||||||
Index++;
|
Index++;
|
||||||
|
@@ -22,7 +22,7 @@ VOID
|
|||||||
BlDisplayBootMenu()
|
BlDisplayBootMenu()
|
||||||
{
|
{
|
||||||
XTBL_DIALOG_HANDLE Handle;
|
XTBL_DIALOG_HANDLE Handle;
|
||||||
PXTBL_BOOTMENU_ITEM MenuEntries = NULL;
|
PXTBL_BOOTMENU_ITEM MenuEntries = NULLPTR;
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
ULONG HighligtedEntryId, OldHighligtedEntryId, NumberOfEntries, TopVisibleEntry, VisibleEntries;
|
ULONG HighligtedEntryId, OldHighligtedEntryId, NumberOfEntries, TopVisibleEntry, VisibleEntries;
|
||||||
BOOLEAN RedrawBootMenu, RedrawEntries;
|
BOOLEAN RedrawBootMenu, RedrawEntries;
|
||||||
@@ -61,7 +61,7 @@ BlDisplayBootMenu()
|
|||||||
TimeOut = -1;
|
TimeOut = -1;
|
||||||
|
|
||||||
/* Check if timeout is specified */
|
/* Check if timeout is specified */
|
||||||
if(TimeOutString != NULL)
|
if(TimeOutString != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Convert timeout string to number */
|
/* Convert timeout string to number */
|
||||||
TimeOut = 0;
|
TimeOut = 0;
|
||||||
@@ -122,7 +122,7 @@ BlDisplayBootMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create a timer event for controlling the timeout of the boot menu */
|
/* Create a timer event for controlling the timeout of the boot menu */
|
||||||
Status = EfiSystemTable->BootServices->CreateEvent(EFI_EVENT_TIMER, EFI_TPL_CALLBACK, NULL, NULL, &TimerEvent);
|
Status = EfiSystemTable->BootServices->CreateEvent(EFI_EVENT_TIMER, EFI_TPL_CALLBACK, NULLPTR, NULLPTR, &TimerEvent);
|
||||||
if(Status == STATUS_EFI_SUCCESS)
|
if(Status == STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Setup new EFI timer */
|
/* Setup new EFI timer */
|
||||||
@@ -444,7 +444,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
(TopVisibleEntry + Index) == HighligtedOptionId);
|
(TopVisibleEntry + Index) == HighligtedOptionId);
|
||||||
|
|
||||||
/* Free allocated value string if needed */
|
/* Free allocated value string if needed */
|
||||||
if(Value != NULL)
|
if(Value != NULLPTR)
|
||||||
{
|
{
|
||||||
BlFreeMemoryPool(Value);
|
BlFreeMemoryPool(Value);
|
||||||
}
|
}
|
||||||
@@ -465,8 +465,8 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
OptionName = EditableOptions[HighligtedOptionId];
|
OptionName = EditableOptions[HighligtedOptionId];
|
||||||
BlGetBootOptionValue(MenuEntry->Options, OptionName, &OriginalValue);
|
BlGetBootOptionValue(MenuEntry->Options, OptionName, &OriginalValue);
|
||||||
|
|
||||||
/* If the original value is NULL, use an empty string for editing */
|
/* If the original value is NULLPTR, use an empty string for editing */
|
||||||
if(OriginalValue == NULL)
|
if(OriginalValue == NULLPTR)
|
||||||
{
|
{
|
||||||
ValueToEdit = L"";
|
ValueToEdit = L"";
|
||||||
}
|
}
|
||||||
@@ -488,7 +488,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Free the original value if it was allocated */
|
/* Free the original value if it was allocated */
|
||||||
if(OriginalValue != NULL)
|
if(OriginalValue != NULLPTR)
|
||||||
{
|
{
|
||||||
BlFreeMemoryPool(OriginalValue);
|
BlFreeMemoryPool(OriginalValue);
|
||||||
}
|
}
|
||||||
@@ -519,7 +519,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
BlpDrawEditMenuEntry(&Handle, EditableOptions[OldHighligtedOptionId], Value, OldHighligtedOptionId - TopVisibleEntry, FALSE);
|
BlpDrawEditMenuEntry(&Handle, EditableOptions[OldHighligtedOptionId], Value, OldHighligtedOptionId - TopVisibleEntry, FALSE);
|
||||||
|
|
||||||
/* Free allocated value string if needed */
|
/* Free allocated value string if needed */
|
||||||
if(Value != NULL)
|
if(Value != NULLPTR)
|
||||||
{
|
{
|
||||||
BlFreeMemoryPool(Value);
|
BlFreeMemoryPool(Value);
|
||||||
}
|
}
|
||||||
@@ -529,7 +529,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
BlpDrawEditMenuEntry(&Handle, EditableOptions[HighligtedOptionId], Value, HighligtedOptionId - TopVisibleEntry, TRUE);
|
BlpDrawEditMenuEntry(&Handle, EditableOptions[HighligtedOptionId], Value, HighligtedOptionId - TopVisibleEntry, TRUE);
|
||||||
|
|
||||||
/* Free allocated value string if needed */
|
/* Free allocated value string if needed */
|
||||||
if(Value != NULL)
|
if(Value != NULLPTR)
|
||||||
{
|
{
|
||||||
BlFreeMemoryPool(Value);
|
BlFreeMemoryPool(Value);
|
||||||
}
|
}
|
||||||
@@ -558,7 +558,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
BlpDrawEditMenuEntry(&Handle, EditableOptions[OldHighligtedOptionId], Value, OldHighligtedOptionId - TopVisibleEntry, FALSE);
|
BlpDrawEditMenuEntry(&Handle, EditableOptions[OldHighligtedOptionId], Value, OldHighligtedOptionId - TopVisibleEntry, FALSE);
|
||||||
|
|
||||||
/* Free allocated value string if needed */
|
/* Free allocated value string if needed */
|
||||||
if(Value != NULL)
|
if(Value != NULLPTR)
|
||||||
{
|
{
|
||||||
BlFreeMemoryPool(Value);
|
BlFreeMemoryPool(Value);
|
||||||
}
|
}
|
||||||
@@ -568,7 +568,7 @@ BlDisplayEditMenu(IN PXTBL_BOOTMENU_ITEM MenuEntry)
|
|||||||
BlpDrawEditMenuEntry(&Handle, EditableOptions[HighligtedOptionId], Value, HighligtedOptionId - TopVisibleEntry, TRUE);
|
BlpDrawEditMenuEntry(&Handle, EditableOptions[HighligtedOptionId], Value, HighligtedOptionId - TopVisibleEntry, TRUE);
|
||||||
|
|
||||||
/* Free allocated value string if needed */
|
/* Free allocated value string if needed */
|
||||||
if(Value != NULL)
|
if(Value != NULLPTR)
|
||||||
{
|
{
|
||||||
BlFreeMemoryPool(Value);
|
BlFreeMemoryPool(Value);
|
||||||
}
|
}
|
||||||
@@ -864,7 +864,7 @@ BlDisplayInputDialog(IN PWCHAR Caption,
|
|||||||
RtlMoveMemory(InputFieldBuffer + TextPosition, InputFieldBuffer + TextPosition + 1,
|
RtlMoveMemory(InputFieldBuffer + TextPosition, InputFieldBuffer + TextPosition + 1,
|
||||||
(InputFieldLength - TextPosition) * sizeof(WCHAR));
|
(InputFieldLength - TextPosition) * sizeof(WCHAR));
|
||||||
|
|
||||||
/* Decrement length and null terminate string */
|
/* Decrement length and NULL terminate string */
|
||||||
InputFieldLength--;
|
InputFieldLength--;
|
||||||
InputFieldBuffer[InputFieldLength] = L'\0';
|
InputFieldBuffer[InputFieldLength] = L'\0';
|
||||||
}
|
}
|
||||||
@@ -882,7 +882,7 @@ BlDisplayInputDialog(IN PWCHAR Caption,
|
|||||||
RtlMoveMemory(InputFieldBuffer + TextPosition - 1, InputFieldBuffer + TextPosition,
|
RtlMoveMemory(InputFieldBuffer + TextPosition - 1, InputFieldBuffer + TextPosition,
|
||||||
(InputFieldLength - TextPosition + 1) * sizeof(WCHAR));
|
(InputFieldLength - TextPosition + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
/* Decrement length, position and null terminate string */
|
/* Decrement length, position and NULL terminate string */
|
||||||
TextPosition--;
|
TextPosition--;
|
||||||
InputFieldLength--;
|
InputFieldLength--;
|
||||||
InputFieldBuffer[InputFieldLength] = L'\0';
|
InputFieldBuffer[InputFieldLength] = L'\0';
|
||||||
@@ -908,7 +908,7 @@ BlDisplayInputDialog(IN PWCHAR Caption,
|
|||||||
(InputFieldLength - TextPosition) * sizeof(WCHAR));
|
(InputFieldLength - TextPosition) * sizeof(WCHAR));
|
||||||
InputFieldBuffer[TextPosition] = Key.UnicodeChar;
|
InputFieldBuffer[TextPosition] = Key.UnicodeChar;
|
||||||
|
|
||||||
/* Increment length, position and null terminate string */
|
/* Increment length, position and NULL terminate string */
|
||||||
TextPosition++;
|
TextPosition++;
|
||||||
InputFieldLength++;
|
InputFieldLength++;
|
||||||
InputFieldBuffer[InputFieldLength] = L'\0';
|
InputFieldBuffer[InputFieldLength] = L'\0';
|
||||||
@@ -1008,7 +1008,7 @@ BlUpdateProgressBar(IN PXTBL_DIALOG_HANDLE Handle,
|
|||||||
IN UCHAR Percentage)
|
IN UCHAR Percentage)
|
||||||
{
|
{
|
||||||
/* Check if message needs an update */
|
/* Check if message needs an update */
|
||||||
if(Message != NULL)
|
if(Message != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Update a message on the dialog box */
|
/* Update a message on the dialog box */
|
||||||
BlpDrawDialogMessage(Handle, Message);
|
BlpDrawDialogMessage(Handle, Message);
|
||||||
@@ -1185,7 +1185,7 @@ BlpDrawBootMenu(OUT PXTBL_DIALOG_HANDLE Handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw empty dialog box for boot menu */
|
/* Draw empty dialog box for boot menu */
|
||||||
BlpDrawDialogBox(Handle, NULL, NULL);
|
BlpDrawDialogBox(Handle, NULLPTR, NULLPTR);
|
||||||
|
|
||||||
/* Print help message below the boot menu */
|
/* Print help message below the boot menu */
|
||||||
BlSetCursorPosition(0, Handle->PosY + Handle->Height);
|
BlSetCursorPosition(0, Handle->PosY + Handle->Height);
|
||||||
@@ -1305,7 +1305,7 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
|||||||
BoxLine[0] = EFI_TEXT_BOX_DOWN_RIGHT;
|
BoxLine[0] = EFI_TEXT_BOX_DOWN_RIGHT;
|
||||||
|
|
||||||
/* Check if there is a caption for this dialog */
|
/* Check if there is a caption for this dialog */
|
||||||
if(Caption != NULL)
|
if(Caption != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Get caption length */
|
/* Get caption length */
|
||||||
CaptionLength = RtlWideStringLength(Caption, 0);
|
CaptionLength = RtlWideStringLength(Caption, 0);
|
||||||
@@ -1366,7 +1366,7 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
|||||||
BoxLine[Handle->Width - 1] = EFI_TEXT_BOX_VERTICAL;
|
BoxLine[Handle->Width - 1] = EFI_TEXT_BOX_VERTICAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add null terminator to the end of the line */
|
/* Add NULL terminator to the end of the line */
|
||||||
BoxLine[Handle->Width] = 0;
|
BoxLine[Handle->Width] = 0;
|
||||||
|
|
||||||
/* Write the line to the console */
|
/* Write the line to the console */
|
||||||
@@ -1374,7 +1374,7 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure there is a caption to print */
|
/* Make sure there is a caption to print */
|
||||||
if(Caption != NULL)
|
if(Caption != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Write dialog box caption */
|
/* Write dialog box caption */
|
||||||
BlSetCursorPosition(Handle->PosX + 3, Handle->PosY);
|
BlSetCursorPosition(Handle->PosX + 3, Handle->PosY);
|
||||||
@@ -1382,7 +1382,7 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure there is a message to print */
|
/* Make sure there is a message to print */
|
||||||
if(Message != NULL)
|
if(Message != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Write a message on the dialog box */
|
/* Write a message on the dialog box */
|
||||||
BlpDrawDialogMessage(Handle, Message);
|
BlpDrawDialogMessage(Handle, Message);
|
||||||
@@ -1514,7 +1514,7 @@ BlpDrawDialogInputField(IN PXTBL_DIALOG_HANDLE Handle,
|
|||||||
InputField[Index] = InputFieldText[Index];
|
InputField[Index] = InputFieldText[Index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add null terminator to the end of the line */
|
/* Add NULL terminator to the end of the line */
|
||||||
InputField[Handle->Width] = 0;
|
InputField[Handle->Width] = 0;
|
||||||
|
|
||||||
/* Write input field text */
|
/* Write input field text */
|
||||||
@@ -1592,7 +1592,7 @@ BlpDrawDialogMessage(IN PXTBL_DIALOG_HANDLE Handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get next line */
|
/* Get next line */
|
||||||
MsgLine = RtlTokenizeWideString(NULL, L"\n", &LastMsgLine);
|
MsgLine = RtlTokenizeWideString(NULLPTR, L"\n", &LastMsgLine);
|
||||||
Line++;
|
Line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1699,7 +1699,7 @@ BlpDrawEditMenu(OUT PXTBL_DIALOG_HANDLE Handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Draw empty dialog box for boot menu */
|
/* Draw empty dialog box for boot menu */
|
||||||
BlpDrawDialogBox(Handle, L"Edit Options", NULL);
|
BlpDrawDialogBox(Handle, L"Edit Options", NULLPTR);
|
||||||
|
|
||||||
/* Print help message below the edit menu */
|
/* Print help message below the edit menu */
|
||||||
BlSetCursorPosition(0, Handle->PosY + Handle->Height);
|
BlSetCursorPosition(0, Handle->PosY + Handle->Height);
|
||||||
@@ -1748,7 +1748,7 @@ BlpDrawEditMenuEntry(IN PXTBL_DIALOG_HANDLE Handle,
|
|||||||
Allocation = FALSE;
|
Allocation = FALSE;
|
||||||
|
|
||||||
/* Set display value depending on input */
|
/* Set display value depending on input */
|
||||||
DisplayValue = (OptionValue != NULL) ? OptionValue : L"";
|
DisplayValue = (OptionValue != NULLPTR) ? OptionValue : L"";
|
||||||
|
|
||||||
/* Determine lengths */
|
/* Determine lengths */
|
||||||
OptionNameLength = RtlWideStringLength(OptionName, 0);
|
OptionNameLength = RtlWideStringLength(OptionName, 0);
|
||||||
|
@@ -27,10 +27,10 @@ BlCloseVolume(IN PEFI_HANDLE VolumeHandle)
|
|||||||
EFI_GUID LIPGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
EFI_GUID LIPGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
||||||
|
|
||||||
/* Make sure a handle specified */
|
/* Make sure a handle specified */
|
||||||
if(VolumeHandle != NULL)
|
if(VolumeHandle != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Close a handle */
|
/* Close a handle */
|
||||||
return EfiSystemTable->BootServices->CloseProtocol(VolumeHandle, &LIPGuid, EfiImageHandle, NULL);
|
return EfiSystemTable->BootServices->CloseProtocol(VolumeHandle, &LIPGuid, EfiImageHandle, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return success */
|
/* Return success */
|
||||||
@@ -50,10 +50,10 @@ BlEnumerateBlockDevices()
|
|||||||
{
|
{
|
||||||
EFI_GUID LoadedImageProtocolGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
EFI_GUID LoadedImageProtocolGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
||||||
EFI_GUID BlockIoGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
|
EFI_GUID BlockIoGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
|
||||||
EFI_HANDLE BootDeviceHandle = NULL, DeviceHandle = NULL;
|
EFI_HANDLE BootDeviceHandle = NULLPTR, DeviceHandle = NULLPTR;
|
||||||
EFI_LOADED_IMAGE_PROTOCOL* LoadedImage;
|
EFI_LOADED_IMAGE_PROTOCOL* LoadedImage;
|
||||||
PEFI_DEVICE_PATH_PROTOCOL DevicePath = NULL, LastNode = NULL;
|
PEFI_DEVICE_PATH_PROTOCOL DevicePath = NULLPTR, LastNode = NULLPTR;
|
||||||
PEFI_BLOCK_DEVICE_DATA ParentNode = NULL;
|
PEFI_BLOCK_DEVICE_DATA ParentNode = NULLPTR;
|
||||||
PEFI_BLOCK_DEVICE_DATA BlockDeviceData;
|
PEFI_BLOCK_DEVICE_DATA BlockDeviceData;
|
||||||
PEFI_BLOCK_DEVICE BlockDevice;
|
PEFI_BLOCK_DEVICE BlockDevice;
|
||||||
LIST_ENTRY BlockDevices;
|
LIST_ENTRY BlockDevices;
|
||||||
@@ -97,7 +97,7 @@ BlEnumerateBlockDevices()
|
|||||||
{
|
{
|
||||||
/* Get data for the next discovered device. */
|
/* Get data for the next discovered device. */
|
||||||
BlockDeviceData = CONTAIN_RECORD(ListEntry, EFI_BLOCK_DEVICE_DATA, ListEntry);
|
BlockDeviceData = CONTAIN_RECORD(ListEntry, EFI_BLOCK_DEVICE_DATA, ListEntry);
|
||||||
PartitionGuid = NULL;
|
PartitionGuid = NULLPTR;
|
||||||
|
|
||||||
/* Find last node */
|
/* Find last node */
|
||||||
Status = BlpFindLastBlockDeviceNode(BlockDeviceData->DevicePath, &LastNode);
|
Status = BlpFindLastBlockDeviceNode(BlockDeviceData->DevicePath, &LastNode);
|
||||||
@@ -172,11 +172,11 @@ BlEnumerateBlockDevices()
|
|||||||
PartitionGuid = (PEFI_GUID)HDPath->Signature;
|
PartitionGuid = (PEFI_GUID)HDPath->Signature;
|
||||||
|
|
||||||
/* Check if this is the EFI System Partition (ESP) */
|
/* Check if this is the EFI System Partition (ESP) */
|
||||||
if(BootDeviceHandle != NULL)
|
if(BootDeviceHandle != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Allocate memory for device path */
|
/* Allocate memory for device path */
|
||||||
DevicePath = BlpDuplicateDevicePath(BlockDeviceData->DevicePath);
|
DevicePath = BlpDuplicateDevicePath(BlockDeviceData->DevicePath);
|
||||||
if(DevicePath != NULL)
|
if(DevicePath != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Check if this is the boot device */
|
/* Check if this is the boot device */
|
||||||
Status = EfiSystemTable->BootServices->LocateDevicePath(&BlockIoGuid, &DevicePath,
|
Status = EfiSystemTable->BootServices->LocateDevicePath(&BlockIoGuid, &DevicePath,
|
||||||
@@ -262,7 +262,7 @@ BlFindVolumeDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL FsHandle,
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
SIZE_T FsPathLength, DevicePathLength = 0;
|
SIZE_T FsPathLength, DevicePathLength = 0;
|
||||||
PEFI_FILEPATH_DEVICE_PATH FilePath = NULL;
|
PEFI_FILEPATH_DEVICE_PATH FilePath = NULLPTR;
|
||||||
PEFI_DEVICE_PATH_PROTOCOL EndDevicePath;
|
PEFI_DEVICE_PATH_PROTOCOL EndDevicePath;
|
||||||
PEFI_DEVICE_PATH_PROTOCOL DevicePathHandle;
|
PEFI_DEVICE_PATH_PROTOCOL DevicePathHandle;
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ BlGetVolumeDevicePath(IN PWCHAR SystemPath,
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
/* Make sure this is not set */
|
/* Make sure this is not set */
|
||||||
*DevicePath = NULL;
|
*DevicePath = NULLPTR;
|
||||||
|
|
||||||
/* Find volume path and its length */
|
/* Find volume path and its length */
|
||||||
Volume = SystemPath;
|
Volume = SystemPath;
|
||||||
@@ -489,7 +489,7 @@ BlGetVolumeDevicePath(IN PWCHAR SystemPath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if volume was found */
|
/* Check if volume was found */
|
||||||
if(*DevicePath == NULL)
|
if(*DevicePath == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Volume not found */
|
/* Volume not found */
|
||||||
BlDebugPrint(L"ERROR: Volume (DriveType: %u, DriveNumber: %lu, PartNumber: %lu) not found\n",
|
BlDebugPrint(L"ERROR: Volume (DriveType: %u, DriveNumber: %lu, PartNumber: %lu) not found\n",
|
||||||
@@ -530,7 +530,7 @@ BlOpenVolume(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
/* Check if device path has been passed or not */
|
/* Check if device path has been passed or not */
|
||||||
if(DevicePath != NULL)
|
if(DevicePath != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Locate the device path */
|
/* Locate the device path */
|
||||||
Status = EfiSystemTable->BootServices->LocateDevicePath(&SFSGuid, &DevicePath, DiskHandle);
|
Status = EfiSystemTable->BootServices->LocateDevicePath(&SFSGuid, &DevicePath, DiskHandle);
|
||||||
@@ -544,7 +544,7 @@ BlOpenVolume(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
|||||||
{
|
{
|
||||||
/* Open the image protocol if no device path specified */
|
/* Open the image protocol if no device path specified */
|
||||||
Status = EfiSystemTable->BootServices->OpenProtocol(EfiImageHandle, &LIPGuid, (PVOID *)&ImageProtocol,
|
Status = EfiSystemTable->BootServices->OpenProtocol(EfiImageHandle, &LIPGuid, (PVOID *)&ImageProtocol,
|
||||||
EfiImageHandle, NULL, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
EfiImageHandle, NULLPTR, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to open image protocol */
|
/* Failed to open image protocol */
|
||||||
@@ -557,7 +557,7 @@ BlOpenVolume(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
|||||||
|
|
||||||
/* Open the filesystem protocol */
|
/* Open the filesystem protocol */
|
||||||
Status = EfiSystemTable->BootServices->OpenProtocol(*DiskHandle, &SFSGuid, (PVOID *)&FileSystemProtocol,
|
Status = EfiSystemTable->BootServices->OpenProtocol(*DiskHandle, &SFSGuid, (PVOID *)&FileSystemProtocol,
|
||||||
EfiImageHandle, NULL, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
EfiImageHandle, NULLPTR, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
|
||||||
|
|
||||||
/* Check if filesystem protocol opened successfully */
|
/* Check if filesystem protocol opened successfully */
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
@@ -718,7 +718,7 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices)
|
|||||||
PEFI_DEVICE_PATH_PROTOCOL DevicePath;
|
PEFI_DEVICE_PATH_PROTOCOL DevicePath;
|
||||||
PEFI_BLOCK_DEVICE_DATA BlockDevice;
|
PEFI_BLOCK_DEVICE_DATA BlockDevice;
|
||||||
UINT_PTR HandlesCount, Index;
|
UINT_PTR HandlesCount, Index;
|
||||||
PEFI_HANDLE Handles = NULL;
|
PEFI_HANDLE Handles = NULLPTR;
|
||||||
PEFI_BLOCK_IO_PROTOCOL Io;
|
PEFI_BLOCK_IO_PROTOCOL Io;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
@@ -738,9 +738,9 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices)
|
|||||||
BlDebugPrint(L"Opening %lu block device from %lu discovered\n", Index + 1, HandlesCount);
|
BlDebugPrint(L"Opening %lu block device from %lu discovered\n", Index + 1, HandlesCount);
|
||||||
|
|
||||||
/* Open I/O protocol for given handle */
|
/* Open I/O protocol for given handle */
|
||||||
Io = NULL;
|
Io = NULLPTR;
|
||||||
Status = BlOpenProtocolHandle(Handles[Index], (PVOID *)&Io, &IoGuid);
|
Status = BlOpenProtocolHandle(Handles[Index], (PVOID *)&Io, &IoGuid);
|
||||||
if(Status != STATUS_EFI_SUCCESS || Io == NULL)
|
if(Status != STATUS_EFI_SUCCESS || Io == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Failed to open I/O protocol, skip it */
|
/* Failed to open I/O protocol, skip it */
|
||||||
BlDebugPrint(L"WARNING: Failed to open EFI Block I/O protocol (Status Code: 0x%zX)\n", Status);
|
BlDebugPrint(L"WARNING: Failed to open EFI Block I/O protocol (Status Code: 0x%zX)\n", Status);
|
||||||
@@ -756,13 +756,13 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if DevicePath protocol is supported by this handle */
|
/* Check if DevicePath protocol is supported by this handle */
|
||||||
DevicePath = NULL;
|
DevicePath = NULLPTR;
|
||||||
Status = EfiSystemTable->BootServices->HandleProtocol(Handles[Index], &DevicePathGuid, (PVOID *)&DevicePath);
|
Status = EfiSystemTable->BootServices->HandleProtocol(Handles[Index], &DevicePathGuid, (PVOID *)&DevicePath);
|
||||||
if(Status != STATUS_EFI_SUCCESS || DevicePath == NULL)
|
if(Status != STATUS_EFI_SUCCESS || DevicePath == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Device failed to handle DP protocol */
|
/* Device failed to handle DP protocol */
|
||||||
BlDebugPrint(L"WARNING: Unable to open DevicePath protocol (Status Code: 0x%zX)\n", Status);
|
BlDebugPrint(L"WARNING: Unable to open DevicePath protocol (Status Code: 0x%zX)\n", Status);
|
||||||
EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &IoGuid, EfiImageHandle, NULL);
|
EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &IoGuid, EfiImageHandle, NULLPTR);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,8 +772,8 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices)
|
|||||||
{
|
{
|
||||||
/* Memory allocation failure */
|
/* Memory allocation failure */
|
||||||
BlDebugPrint(L"ERROR: Failed to allocate memory pool for block device (Status Code: 0x%zX)\n", Status);
|
BlDebugPrint(L"ERROR: Failed to allocate memory pool for block device (Status Code: 0x%zX)\n", Status);
|
||||||
EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &DevicePathGuid, EfiImageHandle, NULL);
|
EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &DevicePathGuid, EfiImageHandle, NULLPTR);
|
||||||
EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &IoGuid, EfiImageHandle, NULL);
|
EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &IoGuid, EfiImageHandle, NULLPTR);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -983,11 +983,11 @@ BlpDuplicateDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath)
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT Length = 0;
|
UINT Length = 0;
|
||||||
|
|
||||||
/* Check if the input device path is NULL */
|
/* Check if the input device path is NULL pointer */
|
||||||
if(!DevicePath)
|
if(!DevicePath)
|
||||||
{
|
{
|
||||||
/* Nothing to duplicate */
|
/* Nothing to duplicate */
|
||||||
return NULL;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start iterating from the beginning of the device path */
|
/* Start iterating from the beginning of the device path */
|
||||||
@@ -1008,7 +1008,7 @@ BlpDuplicateDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath)
|
|||||||
if(Length == 0)
|
if(Length == 0)
|
||||||
{
|
{
|
||||||
/* Nothing to duplicate */
|
/* Nothing to duplicate */
|
||||||
return NULL;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate memory for the new device path */
|
/* Allocate memory for the new device path */
|
||||||
@@ -1017,7 +1017,7 @@ BlpDuplicateDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath)
|
|||||||
{
|
{
|
||||||
/* Failed to allocate memory */
|
/* Failed to allocate memory */
|
||||||
BlDebugPrint(L"ERROR: Failed to allocate memory pool for device path duplicate (Status Code: 0x%zX)\n", Status);
|
BlDebugPrint(L"ERROR: Failed to allocate memory pool for device path duplicate (Status Code: 0x%zX)\n", Status);
|
||||||
return NULL;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copy the device path */
|
/* Copy the device path */
|
||||||
@@ -1051,7 +1051,7 @@ BlpFindLastBlockDeviceNode(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
|||||||
if(DevicePath->Type == EFI_END_DEVICE_PATH)
|
if(DevicePath->Type == EFI_END_DEVICE_PATH)
|
||||||
{
|
{
|
||||||
/* End reached, nothing to do */
|
/* End reached, nothing to do */
|
||||||
LastNode = NULL;
|
LastNode = NULLPTR;
|
||||||
return STATUS_EFI_INVALID_PARAMETER;
|
return STATUS_EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -146,7 +146,7 @@ BlInitializeBootMenuList(IN ULONG MaxNameLength,
|
|||||||
while(MenuEntrySectionList != BlpMenuList)
|
while(MenuEntrySectionList != BlpMenuList)
|
||||||
{
|
{
|
||||||
/* NULLify menu entry name */
|
/* NULLify menu entry name */
|
||||||
MenuEntryName = NULL;
|
MenuEntryName = NULLPTR;
|
||||||
|
|
||||||
/* Get menu section */
|
/* Get menu section */
|
||||||
MenuEntrySection = CONTAIN_RECORD(MenuEntrySectionList, XTBL_CONFIG_SECTION, Flink);
|
MenuEntrySection = CONTAIN_RECORD(MenuEntrySectionList, XTBL_CONFIG_SECTION, Flink);
|
||||||
@@ -253,7 +253,7 @@ BlInvokeBootProtocol(IN PWCHAR ShortName,
|
|||||||
|
|
||||||
/* Initialize boot parameters and a list of modules */
|
/* Initialize boot parameters and a list of modules */
|
||||||
RtlZeroMemory(&BootParameters, sizeof(XTBL_BOOT_PARAMETERS));
|
RtlZeroMemory(&BootParameters, sizeof(XTBL_BOOT_PARAMETERS));
|
||||||
ModulesList = NULL;
|
ModulesList = NULLPTR;
|
||||||
|
|
||||||
/* Iterate through all options provided by boot menu entry and propagate boot parameters */
|
/* Iterate through all options provided by boot menu entry and propagate boot parameters */
|
||||||
OptionsListEntry = OptionsList->Flink;
|
OptionsListEntry = OptionsList->Flink;
|
||||||
@@ -440,7 +440,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Disable watchdog timer */
|
/* Disable watchdog timer */
|
||||||
Status = EfiSystemTable->BootServices->SetWatchdogTimer(0, 0x10000, 0, NULL);
|
Status = EfiSystemTable->BootServices->SetWatchdogTimer(0, 0x10000, 0, NULLPTR);
|
||||||
if(Status != STATUS_EFI_SUCCESS)
|
if(Status != STATUS_EFI_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to disable the timer, print message */
|
/* Failed to disable the timer, print message */
|
||||||
@@ -479,7 +479,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
|||||||
while(TRUE)
|
while(TRUE)
|
||||||
{
|
{
|
||||||
/* Check if custom boot menu registered */
|
/* Check if custom boot menu registered */
|
||||||
if(BlpStatus.BootMenu != NULL)
|
if(BlpStatus.BootMenu != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Display alternative boot menu */
|
/* Display alternative boot menu */
|
||||||
BlpStatus.BootMenu();
|
BlpStatus.BootMenu();
|
||||||
|
@@ -709,7 +709,7 @@ AR::CpuFunc::StoreSegment(IN USHORT Segment,
|
|||||||
: "=r" (*(PUINT)Destination));
|
: "=r" (*(PUINT)Destination));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Destination = NULL;
|
Destination = NULLPTR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -307,7 +307,7 @@ AR::ProcSup::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
ProcessorBlock->Prcb.CurrentThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
ProcessorBlock->Prcb.CurrentThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
||||||
ProcessorBlock->Prcb.CurrentThread->ApcState.Process = &(KE::KProcess::GetInitialProcess())->ProcessControlBlock;
|
ProcessorBlock->Prcb.CurrentThread->ApcState.Process = &(KE::KProcess::GetInitialProcess())->ProcessControlBlock;
|
||||||
ProcessorBlock->Prcb.IdleThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
ProcessorBlock->Prcb.IdleThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
||||||
ProcessorBlock->Prcb.NextThread = nullptr;
|
ProcessorBlock->Prcb.NextThread = NULLPTR;
|
||||||
|
|
||||||
/* Set initial MXCSR register value */
|
/* Set initial MXCSR register value */
|
||||||
ProcessorBlock->Prcb.MxCsr = INITIAL_MXCSR;
|
ProcessorBlock->Prcb.MxCsr = INITIAL_MXCSR;
|
||||||
|
@@ -679,7 +679,7 @@ AR::CpuFunc::StoreSegment(IN USHORT Segment,
|
|||||||
: "=r" (*(PUINT)Destination));
|
: "=r" (*(PUINT)Destination));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Destination = NULL;
|
Destination = NULLPTR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -304,7 +304,7 @@ AR::ProcSup::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
ProcessorBlock->Prcb.CurrentThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
ProcessorBlock->Prcb.CurrentThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
||||||
ProcessorBlock->Prcb.CurrentThread->ApcState.Process = &(KE::KProcess::GetInitialProcess())->ProcessControlBlock;
|
ProcessorBlock->Prcb.CurrentThread->ApcState.Process = &(KE::KProcess::GetInitialProcess())->ProcessControlBlock;
|
||||||
ProcessorBlock->Prcb.IdleThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
ProcessorBlock->Prcb.IdleThread = &(KE::KThread::GetInitialThread())->ThreadControlBlock;
|
||||||
ProcessorBlock->Prcb.NextThread = nullptr;
|
ProcessorBlock->Prcb.NextThread = NULLPTR;
|
||||||
|
|
||||||
/* Set initial runlevel */
|
/* Set initial runlevel */
|
||||||
ProcessorBlock->RunLevel = PASSIVE_LEVEL;
|
ProcessorBlock->RunLevel = PASSIVE_LEVEL;
|
||||||
|
@@ -106,7 +106,7 @@ XTFASTCALL
|
|||||||
VOID
|
VOID
|
||||||
EX::Rundown::ReInitializeProtection(IN PEX_RUNDOWN_REFERENCE Descriptor)
|
EX::Rundown::ReInitializeProtection(IN PEX_RUNDOWN_REFERENCE Descriptor)
|
||||||
{
|
{
|
||||||
RTL::Atomic::ExchangePointer(&Descriptor->Ptr, NULL);
|
RTL::Atomic::ExchangePointer(&Descriptor->Ptr, NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -71,7 +71,7 @@ HL::Acpi::GetAcpiTable(IN ULONG Signature,
|
|||||||
XTSTATUS Status;
|
XTSTATUS Status;
|
||||||
|
|
||||||
/* Assume ACPI table not found */
|
/* Assume ACPI table not found */
|
||||||
*AcpiTable = nullptr;
|
*AcpiTable = NULLPTR;
|
||||||
|
|
||||||
/* Attempt to get ACPI table from the cache */
|
/* Attempt to get ACPI table from the cache */
|
||||||
Status = QueryAcpiCache(Signature, &Table);
|
Status = QueryAcpiCache(Signature, &Table);
|
||||||
@@ -182,7 +182,7 @@ HL::Acpi::InitializeAcpiSystemDescriptionTable(OUT PACPI_DESCRIPTION_HEADER *Acp
|
|||||||
XTSTATUS Status;
|
XTSTATUS Status;
|
||||||
|
|
||||||
/* Assume ACPI table not found */
|
/* Assume ACPI table not found */
|
||||||
*AcpiTable = nullptr;
|
*AcpiTable = NULLPTR;
|
||||||
|
|
||||||
/* Get ACPI system resource */
|
/* Get ACPI system resource */
|
||||||
Status = KeGetSystemResource(SystemResourceAcpi, &ResourceHeader);
|
Status = KeGetSystemResource(SystemResourceAcpi, &ResourceHeader);
|
||||||
@@ -512,7 +512,7 @@ HL::Acpi::QueryAcpiCache(IN ULONG Signature,
|
|||||||
PLIST_ENTRY ListEntry;
|
PLIST_ENTRY ListEntry;
|
||||||
|
|
||||||
/* Initialize variables */
|
/* Initialize variables */
|
||||||
TableHeader = nullptr;
|
TableHeader = NULLPTR;
|
||||||
|
|
||||||
/* Iterate through ACPI tables cache list */
|
/* Iterate through ACPI tables cache list */
|
||||||
ListEntry = CacheList.Flink;
|
ListEntry = CacheList.Flink;
|
||||||
@@ -534,7 +534,7 @@ HL::Acpi::QueryAcpiCache(IN ULONG Signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the requested ACPI table was found in the cache */
|
/* Check if the requested ACPI table was found in the cache */
|
||||||
if(TableHeader == NULL)
|
if(TableHeader == NULLPTR)
|
||||||
{
|
{
|
||||||
/* ACPI table not found in cache, return error */
|
/* ACPI table not found in cache, return error */
|
||||||
return STATUS_NOT_FOUND;
|
return STATUS_NOT_FOUND;
|
||||||
@@ -580,7 +580,7 @@ HL::Acpi::QueryAcpiTables(IN ULONG Signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure that table header is not set before attempting to find ACPI table */
|
/* Ensure that table header is not set before attempting to find ACPI table */
|
||||||
TableHeader = nullptr;
|
TableHeader = NULLPTR;
|
||||||
|
|
||||||
/* Check if DSDT or FACS table requested */
|
/* Check if DSDT or FACS table requested */
|
||||||
if(Signature == ACPI_DSDT_SIGNATURE || Signature == ACPI_FACS_SIGNATURE)
|
if(Signature == ACPI_DSDT_SIGNATURE || Signature == ACPI_FACS_SIGNATURE)
|
||||||
@@ -634,7 +634,7 @@ HL::Acpi::QueryAcpiTables(IN ULONG Signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get table count depending on root table type */
|
/* Get table count depending on root table type */
|
||||||
if(Xsdt != NULL)
|
if(Xsdt != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Get table count from XSDT */
|
/* Get table count from XSDT */
|
||||||
TableCount = (Xsdt->Header.Length - sizeof(ACPI_DESCRIPTION_HEADER)) / 8;
|
TableCount = (Xsdt->Header.Length - sizeof(ACPI_DESCRIPTION_HEADER)) / 8;
|
||||||
@@ -649,7 +649,7 @@ HL::Acpi::QueryAcpiTables(IN ULONG Signature,
|
|||||||
for(TableIndex = 0; TableIndex < TableCount; TableIndex++)
|
for(TableIndex = 0; TableIndex < TableCount; TableIndex++)
|
||||||
{
|
{
|
||||||
/* Check if XSDP or RSDT is used */
|
/* Check if XSDP or RSDT is used */
|
||||||
if(Xsdt != NULL)
|
if(Xsdt != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Get table header physical address from XSDT */
|
/* Get table header physical address from XSDT */
|
||||||
TableAddress.QuadPart = Xsdt->Tables[TableIndex];
|
TableAddress.QuadPart = Xsdt->Tables[TableIndex];
|
||||||
@@ -662,7 +662,7 @@ HL::Acpi::QueryAcpiTables(IN ULONG Signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether some table is already mapped */
|
/* Check whether some table is already mapped */
|
||||||
if(TableHeader != NULL)
|
if(TableHeader != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Unmap previous table */
|
/* Unmap previous table */
|
||||||
MM::HardwarePool::UnmapHardwareMemory(TableHeader, 2, TRUE);
|
MM::HardwarePool::UnmapHardwareMemory(TableHeader, 2, TRUE);
|
||||||
@@ -689,7 +689,7 @@ HL::Acpi::QueryAcpiTables(IN ULONG Signature,
|
|||||||
if(TableHeader->Signature != Signature)
|
if(TableHeader->Signature != Signature)
|
||||||
{
|
{
|
||||||
/* ACPI table not found, check if cleanup is needed */
|
/* ACPI table not found, check if cleanup is needed */
|
||||||
if(TableHeader != NULL)
|
if(TableHeader != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Unmap non-matching ACPI table */
|
/* Unmap non-matching ACPI table */
|
||||||
MM::HardwarePool::UnmapHardwareMemory(TableHeader, 2, TRUE);
|
MM::HardwarePool::UnmapHardwareMemory(TableHeader, 2, TRUE);
|
||||||
|
@@ -19,7 +19,7 @@ PKD_INIT_ROUTINE KD::DebugIo::IoProvidersInitRoutines[KDBG_PROVIDERS_COUNT] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Pointer to DbgPrint() routine */
|
/* Pointer to DbgPrint() routine */
|
||||||
PKD_PRINT_ROUTINE KD::DebugIo::KdPrint = nullptr;
|
PKD_PRINT_ROUTINE KD::DebugIo::KdPrint = NULLPTR;
|
||||||
|
|
||||||
/* List of active I/O providers */
|
/* List of active I/O providers */
|
||||||
LIST_ENTRY KD::DebugIo::Providers;
|
LIST_ENTRY KD::DebugIo::Providers;
|
||||||
|
@@ -99,7 +99,8 @@ KE::KernelInit::StartKernel(VOID)
|
|||||||
CurrentProcess->Quantum = MAXCHAR;
|
CurrentProcess->Quantum = MAXCHAR;
|
||||||
|
|
||||||
/* Initialize Idle thread */
|
/* Initialize Idle thread */
|
||||||
KThread::InitializeThread(CurrentProcess, CurrentThread, nullptr, nullptr, nullptr, nullptr, nullptr, AR::ProcSup::GetBootStack(), TRUE);
|
KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||||
|
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
||||||
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
||||||
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
||||||
CurrentThread->State = Running;
|
CurrentThread->State = Running;
|
||||||
|
@@ -99,7 +99,7 @@ KE::KThread::InitializeThreadContext(IN PKTHREAD Thread,
|
|||||||
Thread->NpxState = NPX_STATE_UNUSED;
|
Thread->NpxState = NPX_STATE_UNUSED;
|
||||||
|
|
||||||
/* Set thread start address */
|
/* Set thread start address */
|
||||||
ThreadFrame->StartFrame.Return = (ULONG64)NULL;
|
ThreadFrame->StartFrame.Return = (ULONG64)NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize thread startup information */
|
/* Initialize thread startup information */
|
||||||
|
@@ -83,7 +83,7 @@ KE::Apc::InitializeApc(IN PKAPC Apc,
|
|||||||
{
|
{
|
||||||
/* Set context and mode for special APC */
|
/* Set context and mode for special APC */
|
||||||
Apc->ApcMode = KernelMode;
|
Apc->ApcMode = KernelMode;
|
||||||
Apc->NormalContext = NULL;
|
Apc->NormalContext = NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark APC as not inserted yet */
|
/* Mark APC as not inserted yet */
|
||||||
|
@@ -44,7 +44,7 @@ KE::BootInformation::GetFirmwareType(VOID)
|
|||||||
* Supplies a pointer to a null-terminated wide string specifying the name of the parameter to search for.
|
* Supplies a pointer to a null-terminated wide string specifying the name of the parameter to search for.
|
||||||
*
|
*
|
||||||
* @param Parameter
|
* @param Parameter
|
||||||
* Supplies a pointer to a variable that receives a pointer to the matching parameter, or NULL if not found.
|
* Supplies a pointer to a variable that receives a pointer to the matching parameter, or NULLPTR if not found.
|
||||||
*
|
*
|
||||||
* @return This routine returns a status code.
|
* @return This routine returns a status code.
|
||||||
*
|
*
|
||||||
@@ -74,7 +74,7 @@ KE::BootInformation::GetKernelParameter(IN PCWSTR ParameterName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Assume the requested parameter is not present in the kernel parameters */
|
/* Assume the requested parameter is not present in the kernel parameters */
|
||||||
*Parameter = nullptr;
|
*Parameter = NULLPTR;
|
||||||
|
|
||||||
/* Start searching from the beginning of the list */
|
/* Start searching from the beginning of the list */
|
||||||
SearchStart = InitializationBlock->KernelParameters;
|
SearchStart = InitializationBlock->KernelParameters;
|
||||||
|
@@ -39,7 +39,7 @@ KE::Dpc::InitializeDpc(IN PKDPC Dpc,
|
|||||||
/* Initialize DPC routine and context data */
|
/* Initialize DPC routine and context data */
|
||||||
Dpc->DeferredContext = DpcContext;
|
Dpc->DeferredContext = DpcContext;
|
||||||
Dpc->DeferredRoutine = DpcRoutine;
|
Dpc->DeferredRoutine = DpcRoutine;
|
||||||
Dpc->DpcData = NULL;
|
Dpc->DpcData = NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +72,7 @@ KE::Dpc::InitializeThreadedDpc(IN PKDPC Dpc,
|
|||||||
/* Initialize DPC routine and context data */
|
/* Initialize DPC routine and context data */
|
||||||
Dpc->DeferredContext = DpcContext;
|
Dpc->DeferredContext = DpcContext;
|
||||||
Dpc->DeferredRoutine = DpcRoutine;
|
Dpc->DeferredRoutine = DpcRoutine;
|
||||||
Dpc->DpcData = NULL;
|
Dpc->DpcData = NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -99,7 +99,8 @@ KE::KernelInit::StartKernel(VOID)
|
|||||||
CurrentProcess->Quantum = MAXCHAR;
|
CurrentProcess->Quantum = MAXCHAR;
|
||||||
|
|
||||||
/* Initialize Idle thread */
|
/* Initialize Idle thread */
|
||||||
KThread::InitializeThread(CurrentProcess, CurrentThread, nullptr, nullptr, nullptr, nullptr, nullptr, AR::ProcSup::GetBootStack(), TRUE);
|
KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||||
|
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
||||||
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
||||||
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
||||||
CurrentThread->State = Running;
|
CurrentThread->State = Running;
|
||||||
|
@@ -47,7 +47,7 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize boot CPU */
|
/* Initialize boot CPU */
|
||||||
AR::ProcSup::InitializeProcessor(NULL);
|
AR::ProcSup::InitializeProcessor(NULLPTR);
|
||||||
|
|
||||||
/* Initialize system resources */
|
/* Initialize system resources */
|
||||||
SystemResources::InitializeResources();
|
SystemResources::InitializeResources();
|
||||||
|
@@ -131,7 +131,7 @@ KE::KThread::InitializeThread(IN PKPROCESS Process,
|
|||||||
|
|
||||||
/* Initialize kernel-mode suspend APC */
|
/* Initialize kernel-mode suspend APC */
|
||||||
Apc::InitializeApc(&Thread->SuspendApc, Thread, OriginalApcEnvironment, SuspendNop,
|
Apc::InitializeApc(&Thread->SuspendApc, Thread, OriginalApcEnvironment, SuspendNop,
|
||||||
SuspendRundown, SuspendThread, KernelMode, NULL);
|
SuspendRundown, SuspendThread, KernelMode, NULLPTR);
|
||||||
|
|
||||||
/* Initialize suspend semaphore */
|
/* Initialize suspend semaphore */
|
||||||
Semaphore::InitializeSemaphore(&Thread->SuspendSemaphore, 0, 2);
|
Semaphore::InitializeSemaphore(&Thread->SuspendSemaphore, 0, 2);
|
||||||
@@ -179,8 +179,8 @@ KE::KThread::InitializeThread(IN PKPROCESS Process,
|
|||||||
{
|
{
|
||||||
/* Deallocate stack */
|
/* Deallocate stack */
|
||||||
MM::KernelPool::FreeKernelStack(Stack, FALSE);
|
MM::KernelPool::FreeKernelStack(Stack, FALSE);
|
||||||
Thread->InitialStack = NULL;
|
Thread->InitialStack = NULLPTR;
|
||||||
Thread->StackBase = NULL;
|
Thread->StackBase = NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Thread initialization failed */
|
/* Thread initialization failed */
|
||||||
|
@@ -104,8 +104,8 @@ KE::SystemResources::GetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
|
|||||||
/* Check if resource was found */
|
/* Check if resource was found */
|
||||||
if(ListEntry == &ResourcesListHead)
|
if(ListEntry == &ResourcesListHead)
|
||||||
{
|
{
|
||||||
/* Resource not found, return NULL */
|
/* Resource not found, return NULLPTR */
|
||||||
Resource = nullptr;
|
Resource = NULLPTR;
|
||||||
Status = STATUS_NOT_FOUND;
|
Status = STATUS_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ MM::PageMap::ClearPte(PHARDWARE_PTE PtePointer)
|
|||||||
* @param Address
|
* @param Address
|
||||||
* Specifies the virtual address for which to retrieve the corresponding P5E.
|
* Specifies the virtual address for which to retrieve the corresponding P5E.
|
||||||
*
|
*
|
||||||
* @return This routine returns the address of the P5E, or NULL if LA57 is not enabled.
|
* @return This routine returns the address of the P5E, or NULLPTR if LA57 is not enabled.
|
||||||
*
|
*
|
||||||
* @since XT 1.0
|
* @since XT 1.0
|
||||||
*/
|
*/
|
||||||
|
@@ -176,13 +176,13 @@ MM::HardwarePool::MapHardwareMemory(IN PHYSICAL_ADDRESS PhysicalAddress,
|
|||||||
BaseAddress = HardwareHeapStart;
|
BaseAddress = HardwareHeapStart;
|
||||||
MappedPages = 0;
|
MappedPages = 0;
|
||||||
ReturnAddress = BaseAddress;
|
ReturnAddress = BaseAddress;
|
||||||
*VirtualAddress = NULL;
|
*VirtualAddress = NULLPTR;
|
||||||
|
|
||||||
/* Iterate through all pages */
|
/* Iterate through all pages */
|
||||||
while(MappedPages < PageCount)
|
while(MappedPages < PageCount)
|
||||||
{
|
{
|
||||||
/* Check if address overflows */
|
/* Check if address overflows */
|
||||||
if(BaseAddress == NULL)
|
if(BaseAddress == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Not enough free pages, return error */
|
/* Not enough free pages, return error */
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
@@ -524,7 +524,7 @@ RTL::Atomic::ExchangePointer(IN PVOID *Address,
|
|||||||
* @param Header
|
* @param Header
|
||||||
* Supplies a pointer to the header of linked list.
|
* Supplies a pointer to the header of linked list.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the original list, or NULL if the list was already empty.
|
* @return This routine returns a pointer to the original list, or NULLPTR if the list was already empty.
|
||||||
*
|
*
|
||||||
* @since XT 1.0
|
* @since XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -532,7 +532,7 @@ XTFASTCALL
|
|||||||
PSINGLE_LIST_ENTRY
|
PSINGLE_LIST_ENTRY
|
||||||
RTL::Atomic::FlushSingleList(IN PSINGLE_LIST_HEADER Header)
|
RTL::Atomic::FlushSingleList(IN PSINGLE_LIST_HEADER Header)
|
||||||
{
|
{
|
||||||
return (PSINGLE_LIST_ENTRY)Exchange64((PLONG_PTR)&Header->Alignment, (LONGLONG)NULL);
|
return (PSINGLE_LIST_ENTRY)Exchange64((PLONG_PTR)&Header->Alignment, (LONGLONG)NULLPTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -693,7 +693,7 @@ RTL::Atomic::Or64(IN PLONG_PTR Address,
|
|||||||
* @param Header
|
* @param Header
|
||||||
* Supplies a pointer to the header of a single linked list.
|
* Supplies a pointer to the header of a single linked list.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the removed element, or NULL if the list was empty.
|
* @return This routine returns a pointer to the removed element, or NULLPTR if the list was empty.
|
||||||
*
|
*
|
||||||
* @since XT 1.0
|
* @since XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -712,7 +712,7 @@ RTL::Atomic::PopEntrySingleList(IN PSINGLE_LIST_HEADER Header)
|
|||||||
if(!FirstEntry)
|
if(!FirstEntry)
|
||||||
{
|
{
|
||||||
/* Empty list */
|
/* Empty list */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update link */
|
/* Update link */
|
||||||
@@ -737,7 +737,7 @@ RTL::Atomic::PopEntrySingleList(IN PSINGLE_LIST_HEADER Header)
|
|||||||
* @param Entry
|
* @param Entry
|
||||||
* Supplies a pointer to entry, that will be inserted into linked list.
|
* Supplies a pointer to entry, that will be inserted into linked list.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to original heading, or NULL if the list was originally empty.
|
* @return This routine returns a pointer to original heading, or NULLPTR if the list was originally empty.
|
||||||
*
|
*
|
||||||
* @since XT 1.0
|
* @since XT 1.0
|
||||||
*/
|
*/
|
||||||
|
@@ -256,10 +256,10 @@ RtlCompareWideStringInsensitive(IN PCWSTR String1,
|
|||||||
* Appends a copy of the source string to the end of the destination string.
|
* Appends a copy of the source string to the end of the destination string.
|
||||||
*
|
*
|
||||||
* @param Destination
|
* @param Destination
|
||||||
* Supplies a pointer to the null-terminated string to append to.
|
* Supplies a pointer to the NULL-terminated string to append to.
|
||||||
*
|
*
|
||||||
* @param Source
|
* @param Source
|
||||||
* Supplies a pointer to the null-terminated string to copy from.
|
* Supplies a pointer to the NULL-terminated string to copy from.
|
||||||
*
|
*
|
||||||
* @param Count
|
* @param Count
|
||||||
* Sets a maximum number of characters to copy. If no limit set, appends whole string.
|
* Sets a maximum number of characters to copy. If no limit set, appends whole string.
|
||||||
@@ -282,10 +282,10 @@ RtlConcatenateString(OUT PCHAR Destination,
|
|||||||
* Appends a copy of the source wide string to the end of the destination wide string.
|
* Appends a copy of the source wide string to the end of the destination wide string.
|
||||||
*
|
*
|
||||||
* @param Destination
|
* @param Destination
|
||||||
* Supplies a pointer to the null-terminated wide string to append to.
|
* Supplies a pointer to the NULL-terminated wide string to append to.
|
||||||
*
|
*
|
||||||
* @param Source
|
* @param Source
|
||||||
* Supplies a pointer to the null-terminated wide string to copy from.
|
* Supplies a pointer to the NULL-terminated wide string to copy from.
|
||||||
*
|
*
|
||||||
* @param Count
|
* @param Count
|
||||||
* Sets a maximum number of wide characters to copy. If no limit set, appends whole wide string.
|
* Sets a maximum number of wide characters to copy. If no limit set, appends whole wide string.
|
||||||
@@ -967,12 +967,12 @@ RtlSetMemory(OUT PVOID Destination,
|
|||||||
* Calculates the length of a given string.
|
* Calculates the length of a given string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be examined.
|
* Pointer to the NULL-terminated string to be examined.
|
||||||
*
|
*
|
||||||
* @param MaxLength
|
* @param MaxLength
|
||||||
* Maximum number of characters to examine. If no limit set, it examines whole string.
|
* Maximum number of characters to examine. If no limit set, it examines whole string.
|
||||||
*
|
*
|
||||||
* @return The length of the null-terminated string.
|
* @return The length of the NULL-terminated string.
|
||||||
*
|
*
|
||||||
* @since: XT 1.0
|
* @since: XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -1034,13 +1034,13 @@ RtlTestBit(IN PRTL_BITMAP BitMap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the next token in a null-terminated string.
|
* Finds the next token in a NULL-terminated string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to tokenize.
|
* Pointer to the NULL-terminated string to tokenize.
|
||||||
*
|
*
|
||||||
* @param Delimiter
|
* @param Delimiter
|
||||||
* Pointer to the null-terminated string identifying delimiters.
|
* Pointer to the NULL-terminated string identifying delimiters.
|
||||||
*
|
*
|
||||||
* @param SavePtr
|
* @param SavePtr
|
||||||
* Pointer to an object used to store routine internal state.
|
* Pointer to an object used to store routine internal state.
|
||||||
@@ -1060,18 +1060,18 @@ RtlTokenizeString(IN PCHAR String,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the next token in a null-terminated wide string.
|
* Finds the next token in a NULL-terminated wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to tokenize.
|
* Pointer to the NULL-terminated wide string to tokenize.
|
||||||
*
|
*
|
||||||
* @param Delimiter
|
* @param Delimiter
|
||||||
* Pointer to the null-terminated wide string identifying delimiters.
|
* Pointer to the NULL-terminated wide string identifying delimiters.
|
||||||
*
|
*
|
||||||
* @param SavePtr
|
* @param SavePtr
|
||||||
* Pointer to an object used to store routine internal state.
|
* Pointer to an object used to store routine internal state.
|
||||||
*
|
*
|
||||||
* @return Pointer to the beginning of the next token or NULL if there are no more tokens.
|
* @return Pointer to the beginning of the next token or NULLPTR if there are no more tokens.
|
||||||
*
|
*
|
||||||
* @since: XT 1.0
|
* @since: XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -1161,7 +1161,7 @@ RtlToUpperWideCharacter(IN WCHAR Character)
|
|||||||
* Removes certain characters from a beginning of the string.
|
* Removes certain characters from a beginning of the string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be trimmed.
|
* Pointer to the NULL-terminated string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the left-trimmed string.
|
* @return This routine returns a pointer to the left-trimmed string.
|
||||||
*
|
*
|
||||||
@@ -1179,7 +1179,7 @@ RtlTrimLeftString(IN PCHAR String)
|
|||||||
* Removes certain characters from a beginning of the wide string.
|
* Removes certain characters from a beginning of the wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be trimmed.
|
* Pointer to the NULL-terminated wide string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the left-trimmed wide string.
|
* @return This routine returns a pointer to the left-trimmed wide string.
|
||||||
*
|
*
|
||||||
@@ -1197,7 +1197,7 @@ RtlTrimLeftWideString(IN PWCHAR String)
|
|||||||
* Removes certain characters from the end of the string.
|
* Removes certain characters from the end of the string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be trimmed.
|
* Pointer to the NULL-terminated string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the right-trimmed string.
|
* @return This routine returns a pointer to the right-trimmed string.
|
||||||
*
|
*
|
||||||
@@ -1215,7 +1215,7 @@ RtlTrimRightString(IN PCHAR String)
|
|||||||
* Removes certain characters from the end of the wide string.
|
* Removes certain characters from the end of the wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be trimmed.
|
* Pointer to the NULL-terminated wide string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the right-trimmed wide string.
|
* @return This routine returns a pointer to the right-trimmed wide string.
|
||||||
*
|
*
|
||||||
@@ -1233,7 +1233,7 @@ RtlTrimRightWideString(IN PWCHAR String)
|
|||||||
* Removes certain characters from the beginning and the end of the string.
|
* Removes certain characters from the beginning and the end of the string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be trimmed.
|
* Pointer to the NULL-terminated string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the trimmed string.
|
* @return This routine returns a pointer to the trimmed string.
|
||||||
*
|
*
|
||||||
@@ -1251,7 +1251,7 @@ RtlTrimString(IN PCHAR String)
|
|||||||
* Removes certain characters from the beginning and the end of the wide string.
|
* Removes certain characters from the beginning and the end of the wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be trimmed.
|
* Pointer to the NULL-terminated wide string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the trimmed wide string.
|
* @return This routine returns a pointer to the trimmed wide string.
|
||||||
*
|
*
|
||||||
@@ -1269,12 +1269,12 @@ RtlTrimWideString(IN PWCHAR String)
|
|||||||
* Calculates the length of a given wide string.
|
* Calculates the length of a given wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be examined.
|
* Pointer to the NULL-terminated wide string to be examined.
|
||||||
*
|
*
|
||||||
* @param MaxLength
|
* @param MaxLength
|
||||||
* Maximum number of wide characters to examine. If no limit set, it examines whole string.
|
* Maximum number of wide characters to examine. If no limit set, it examines whole string.
|
||||||
*
|
*
|
||||||
* @return The length of the null-terminated wide string.
|
* @return The length of the NULL-terminated wide string.
|
||||||
*
|
*
|
||||||
* @since: XT 1.0
|
* @since: XT 1.0
|
||||||
*/
|
*/
|
||||||
|
@@ -107,7 +107,7 @@ XTCDECL
|
|||||||
BOOLEAN
|
BOOLEAN
|
||||||
RTL::LinkedList::ListEmpty(IN PLIST_ENTRY ListHead)
|
RTL::LinkedList::ListEmpty(IN PLIST_ENTRY ListHead)
|
||||||
{
|
{
|
||||||
return (BOOLEAN)(((ListHead->Flink == NULL) && (ListHead->Blink == NULL)) || (ListHead->Flink == ListHead));
|
return (BOOLEAN)(((ListHead->Flink == NULLPTR) && (ListHead->Blink == NULLPTR)) || (ListHead->Flink == ListHead));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,7 +127,7 @@ RTL::LinkedList::ListLoop(IN PLIST_ENTRY ListHead)
|
|||||||
PLIST_ENTRY SlowEntry, FastEntry;
|
PLIST_ENTRY SlowEntry, FastEntry;
|
||||||
|
|
||||||
/* Check if list exists */
|
/* Check if list exists */
|
||||||
if(ListHead == NULL)
|
if(ListHead == NULLPTR)
|
||||||
{
|
{
|
||||||
/* No loop in non-existen list */
|
/* No loop in non-existen list */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -138,7 +138,7 @@ RTL::LinkedList::ListLoop(IN PLIST_ENTRY ListHead)
|
|||||||
SlowEntry = ListHead;
|
SlowEntry = ListHead;
|
||||||
|
|
||||||
/* Iterate through the linked list to find a loop */
|
/* Iterate through the linked list to find a loop */
|
||||||
while(SlowEntry != NULL && FastEntry != NULL && FastEntry->Flink != NULL)
|
while(SlowEntry != NULLPTR && FastEntry != NULLPTR && FastEntry->Flink != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Move slow and fast pointers by one and two positions accordingly */
|
/* Move slow and fast pointers by one and two positions accordingly */
|
||||||
SlowEntry = SlowEntry->Flink;
|
SlowEntry = SlowEntry->Flink;
|
||||||
|
@@ -193,7 +193,7 @@ RTL::Math::Divide64(IN LONGLONG Dividend,
|
|||||||
|
|
||||||
/* Calculate the quotient */
|
/* Calculate the quotient */
|
||||||
DividendSign ^= DivisorSign;
|
DividendSign ^= DivisorSign;
|
||||||
Quotient = (DivideUnsigned64(UDividend, UDivisor, nullptr) ^ DividendSign) - DividendSign;
|
Quotient = (DivideUnsigned64(UDividend, UDivisor, NULLPTR) ^ DividendSign) - DividendSign;
|
||||||
|
|
||||||
/* Make sure a pointer to remainder provided */
|
/* Make sure a pointer to remainder provided */
|
||||||
if(Remainder)
|
if(Remainder)
|
||||||
@@ -284,7 +284,7 @@ RTL::Math::DivideUnsigned64(IN ULONGLONG Dividend,
|
|||||||
if(DivisorParts.u.HighPart == 0)
|
if(DivisorParts.u.HighPart == 0)
|
||||||
{
|
{
|
||||||
/* 32-bit divide operation, check if remainder provided */
|
/* 32-bit divide operation, check if remainder provided */
|
||||||
if(Remainder != NULL)
|
if(Remainder != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Calculate remainder */
|
/* Calculate remainder */
|
||||||
*Remainder = DividendParts.u.LowPart % DivisorParts.u.LowPart;
|
*Remainder = DividendParts.u.LowPart % DivisorParts.u.LowPart;
|
||||||
@@ -295,7 +295,7 @@ RTL::Math::DivideUnsigned64(IN ULONGLONG Dividend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 32-bit value divided by a 64-bit value, check if remainder provided */
|
/* 32-bit value divided by a 64-bit value, check if remainder provided */
|
||||||
if(Remainder != NULL)
|
if(Remainder != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Calculate remainder */
|
/* Calculate remainder */
|
||||||
*Remainder = DividendParts.u.LowPart;
|
*Remainder = DividendParts.u.LowPart;
|
||||||
@@ -318,7 +318,7 @@ RTL::Math::DivideUnsigned64(IN ULONGLONG Dividend,
|
|||||||
if(Shift > ((sizeof(ULONG) * BITS_PER_BYTE) - 1))
|
if(Shift > ((sizeof(ULONG) * BITS_PER_BYTE) - 1))
|
||||||
{
|
{
|
||||||
/* Check if remainder provided */
|
/* Check if remainder provided */
|
||||||
if(Remainder != NULL)
|
if(Remainder != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Calculate remainder */
|
/* Calculate remainder */
|
||||||
*Remainder = DividendParts.QuadPart;
|
*Remainder = DividendParts.QuadPart;
|
||||||
@@ -388,7 +388,7 @@ RTL::Math::DivideUnsigned64(IN ULONGLONG Dividend,
|
|||||||
if(DividendParts.u.LowPart == 0)
|
if(DividendParts.u.LowPart == 0)
|
||||||
{
|
{
|
||||||
/* Check if remainder provided */
|
/* Check if remainder provided */
|
||||||
if(Remainder != NULL)
|
if(Remainder != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Calculate the remainder */
|
/* Calculate the remainder */
|
||||||
RemainderParts.u.HighPart = DividendParts.u.HighPart % DivisorParts.u.HighPart;
|
RemainderParts.u.HighPart = DividendParts.u.HighPart % DivisorParts.u.HighPart;
|
||||||
@@ -407,7 +407,7 @@ RTL::Math::DivideUnsigned64(IN ULONGLONG Dividend,
|
|||||||
if(Shift > ((sizeof(ULONG) * BITS_PER_BYTE) - 2))
|
if(Shift > ((sizeof(ULONG) * BITS_PER_BYTE) - 2))
|
||||||
{
|
{
|
||||||
/* Check if remainder provided */
|
/* Check if remainder provided */
|
||||||
if(Remainder != NULL)
|
if(Remainder != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Calculate the remainder */
|
/* Calculate the remainder */
|
||||||
*Remainder = DividendParts.QuadPart;
|
*Remainder = DividendParts.QuadPart;
|
||||||
@@ -457,7 +457,7 @@ RTL::Math::DivideUnsigned64(IN ULONGLONG Dividend,
|
|||||||
QuotientParts.QuadPart = (QuotientParts.QuadPart << 1) | Carry;
|
QuotientParts.QuadPart = (QuotientParts.QuadPart << 1) | Carry;
|
||||||
|
|
||||||
/* Check if remainder provided */
|
/* Check if remainder provided */
|
||||||
if(Remainder != NULL)
|
if(Remainder != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Calculate the remainder */
|
/* Calculate the remainder */
|
||||||
*Remainder = RemainderParts.QuadPart;
|
*Remainder = RemainderParts.QuadPart;
|
||||||
@@ -497,7 +497,7 @@ RTL::Math::DivideLargeInteger(IN LARGE_INTEGER Dividend,
|
|||||||
UDividend = (Dividend.QuadPart ^ DividendSign) - DividendSign;
|
UDividend = (Dividend.QuadPart ^ DividendSign) - DividendSign;
|
||||||
|
|
||||||
/* Calculate the quotient */
|
/* Calculate the quotient */
|
||||||
LargeInt.QuadPart = (DivideUnsigned64(UDividend, Divisor, nullptr) ^ DividendSign) - DividendSign;
|
LargeInt.QuadPart = (DivideUnsigned64(UDividend, Divisor, NULLPTR) ^ DividendSign) - DividendSign;
|
||||||
|
|
||||||
/* Make sure a pointer to remainder provided */
|
/* Make sure a pointer to remainder provided */
|
||||||
if(Remainder)
|
if(Remainder)
|
||||||
|
@@ -132,10 +132,10 @@ RTL::String::CompareStringInsensitive(IN PCSTR String1,
|
|||||||
* Appends a copy of the source string to the end of the destination string.
|
* Appends a copy of the source string to the end of the destination string.
|
||||||
*
|
*
|
||||||
* @param Destination
|
* @param Destination
|
||||||
* Supplies a pointer to the null-terminated string to append to.
|
* Supplies a pointer to the NULL-terminated string to append to.
|
||||||
*
|
*
|
||||||
* @param Source
|
* @param Source
|
||||||
* Supplies a pointer to the null-terminated string to copy from.
|
* Supplies a pointer to the NULL-terminated string to copy from.
|
||||||
*
|
*
|
||||||
* @param Count
|
* @param Count
|
||||||
* Sets a maximum number of characters to copy. If no limit set, appends whole string.
|
* Sets a maximum number of characters to copy. If no limit set, appends whole string.
|
||||||
@@ -164,7 +164,7 @@ RTL::String::ConcatenateString(OUT PCHAR Destination,
|
|||||||
/* Copy character-by-character */
|
/* Copy character-by-character */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
/* Check if NULL terminated character found */
|
/* Check if NULL-terminated character found */
|
||||||
if((*Destination = *Source++) == '\0')
|
if((*Destination = *Source++) == '\0')
|
||||||
{
|
{
|
||||||
/* Break on '\0' character */
|
/* Break on '\0' character */
|
||||||
@@ -174,7 +174,7 @@ RTL::String::ConcatenateString(OUT PCHAR Destination,
|
|||||||
}
|
}
|
||||||
while(--Count != 0);
|
while(--Count != 0);
|
||||||
|
|
||||||
/* Add NULL termination character to the end of destination string */
|
/* Add NULL-termination character to the end of destination string */
|
||||||
*Destination = '\0';
|
*Destination = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -217,7 +217,7 @@ RTL::String::CopyString(IN PCHAR Destination,
|
|||||||
/* Copy source character */
|
/* Copy source character */
|
||||||
Destination[Index] = Source[Index];
|
Destination[Index] = Source[Index];
|
||||||
|
|
||||||
/* Check if NULL terminated character found */
|
/* Check if NULL-terminated character found */
|
||||||
if(Source[Index] == '\0')
|
if(Source[Index] == '\0')
|
||||||
{
|
{
|
||||||
/* End of source string reached */
|
/* End of source string reached */
|
||||||
@@ -253,8 +253,8 @@ RTL::String::FindString(IN PCSTR Source,
|
|||||||
/* Validate input parameters */
|
/* Validate input parameters */
|
||||||
if(!Source || !Search)
|
if(!Source || !Search)
|
||||||
{
|
{
|
||||||
/* Invalid input parameters, return NULL */
|
/* Invalid input parameters, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if search string is empty */
|
/* Check if search string is empty */
|
||||||
@@ -287,8 +287,8 @@ RTL::String::FindString(IN PCSTR Source,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No match found, return NULL */
|
/* No match found, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,8 +315,8 @@ RTL::String::FindStringInsensitive(IN PCSTR Source,
|
|||||||
/* Validate input parameters */
|
/* Validate input parameters */
|
||||||
if(!Source || !Search)
|
if(!Source || !Search)
|
||||||
{
|
{
|
||||||
/* Invalid input parameters, return NULL */
|
/* Invalid input parameters, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if search string is empty */
|
/* Check if search string is empty */
|
||||||
@@ -350,8 +350,8 @@ RTL::String::FindStringInsensitive(IN PCSTR Source,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No match found, return NULL */
|
/* No match found, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -389,12 +389,12 @@ RTL::String::ReverseString(IN OUT PCHAR String,
|
|||||||
* Calculates the length of a given string.
|
* Calculates the length of a given string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be examined.
|
* Pointer to the NULL-terminated string to be examined.
|
||||||
*
|
*
|
||||||
* @param MaxLength
|
* @param MaxLength
|
||||||
* Maximum number of characters to examine. If no limit set, it examines whole string.
|
* Maximum number of characters to examine. If no limit set, it examines whole string.
|
||||||
*
|
*
|
||||||
* @return The length of the null-terminated string.
|
* @return The length of the NULL-terminated string.
|
||||||
*
|
*
|
||||||
* @since: XT 1.0
|
* @since: XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -406,7 +406,7 @@ RTL::String::StringLength(IN PCSTR String,
|
|||||||
SIZE_T Length;
|
SIZE_T Length;
|
||||||
|
|
||||||
/* Check if NULL pointer passed */
|
/* Check if NULL pointer passed */
|
||||||
if(String == NULL)
|
if(String == NULLPTR)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -453,7 +453,7 @@ RTL::String::StringToWideString(OUT PWCHAR Destination,
|
|||||||
SIZE_T Count = Length;
|
SIZE_T Count = Length;
|
||||||
|
|
||||||
/* Check if NULL pointer passed */
|
/* Check if NULL pointer passed */
|
||||||
if(Destination == NULL)
|
if(Destination == NULLPTR)
|
||||||
{
|
{
|
||||||
/* No wide characters written */
|
/* No wide characters written */
|
||||||
return 0;
|
return 0;
|
||||||
@@ -466,7 +466,7 @@ RTL::String::StringToWideString(OUT PWCHAR Destination,
|
|||||||
if((*Destination = *LocalSource) == 0)
|
if((*Destination = *LocalSource) == 0)
|
||||||
{
|
{
|
||||||
/* End of string reached */
|
/* End of string reached */
|
||||||
LocalSource = nullptr;
|
LocalSource = NULLPTR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,13 +488,13 @@ RTL::String::StringToWideString(OUT PWCHAR Destination,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the next token in a null-terminated string.
|
* Finds the next token in a NULL-terminated string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to tokenize.
|
* Pointer to the NULL-terminated string to tokenize.
|
||||||
*
|
*
|
||||||
* @param Delimiter
|
* @param Delimiter
|
||||||
* Pointer to the null-terminated string identifying delimiters.
|
* Pointer to the NULL-terminated string identifying delimiters.
|
||||||
*
|
*
|
||||||
* @param SavePtr
|
* @param SavePtr
|
||||||
* Pointer to an object used to store routine internal state.
|
* Pointer to an object used to store routine internal state.
|
||||||
@@ -513,18 +513,18 @@ RTL::String::TokenizeString(IN PCHAR String,
|
|||||||
CHAR Char, SpanChar;
|
CHAR Char, SpanChar;
|
||||||
|
|
||||||
/* Check if there is anything to tokenize */
|
/* Check if there is anything to tokenize */
|
||||||
if(String == NULL && (String = *SavePtr) == NULL)
|
if(String == NULLPTR && (String = *SavePtr) == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Empty string given */
|
/* Empty string given */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check non-delimiter characters */
|
/* Check non-delimiter characters */
|
||||||
Char = *String++;
|
Char = *String++;
|
||||||
if(Char == '\0')
|
if(Char == '\0')
|
||||||
{
|
{
|
||||||
*SavePtr = nullptr;
|
*SavePtr = NULLPTR;
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
Token = String - 1;
|
Token = String - 1;
|
||||||
|
|
||||||
@@ -542,7 +542,7 @@ RTL::String::TokenizeString(IN PCHAR String,
|
|||||||
if(Char == '\0')
|
if(Char == '\0')
|
||||||
{
|
{
|
||||||
/* End of string reached, no more tokens */
|
/* End of string reached, no more tokens */
|
||||||
String = nullptr;
|
String = NULLPTR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -615,7 +615,7 @@ RTL::String::ToUpperCharacter(IN CHAR Character)
|
|||||||
* Removes certain characters from a beginning of the string.
|
* Removes certain characters from a beginning of the string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be trimmed.
|
* Pointer to the NULL-terminated string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the left-trimmed string.
|
* @return This routine returns a pointer to the left-trimmed string.
|
||||||
*
|
*
|
||||||
@@ -645,7 +645,7 @@ RTL::String::TrimLeftString(IN PCHAR String)
|
|||||||
* Removes certain characters from the end of the string.
|
* Removes certain characters from the end of the string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be trimmed.
|
* Pointer to the NULL-terminated string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the right-trimmed string.
|
* @return This routine returns a pointer to the right-trimmed string.
|
||||||
*
|
*
|
||||||
@@ -678,7 +678,7 @@ RTL::String::TrimRightString(IN PCHAR String)
|
|||||||
* Removes certain characters from the beginning and the end of the string.
|
* Removes certain characters from the beginning and the end of the string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated string to be trimmed.
|
* Pointer to the NULL-terminated string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the trimmed string.
|
* @return This routine returns a pointer to the trimmed string.
|
||||||
*
|
*
|
||||||
|
@@ -132,10 +132,10 @@ RTL::WideString::CompareWideStringInsensitive(IN PCWSTR String1,
|
|||||||
* Appends a copy of the source wide string to the end of the destination wide string.
|
* Appends a copy of the source wide string to the end of the destination wide string.
|
||||||
*
|
*
|
||||||
* @param Destination
|
* @param Destination
|
||||||
* Supplies a pointer to the null-terminated wide string to append to.
|
* Supplies a pointer to the NULL-terminated wide string to append to.
|
||||||
*
|
*
|
||||||
* @param Source
|
* @param Source
|
||||||
* Supplies a pointer to the null-terminated wide string to copy from.
|
* Supplies a pointer to the NULL-terminated wide string to copy from.
|
||||||
*
|
*
|
||||||
* @param Count
|
* @param Count
|
||||||
* Sets a maximum number of wide characters to copy. If no limit set, appends whole wide string.
|
* Sets a maximum number of wide characters to copy. If no limit set, appends whole wide string.
|
||||||
@@ -253,8 +253,8 @@ RTL::WideString::FindWideString(IN PCWSTR Source,
|
|||||||
/* Validate input parameters */
|
/* Validate input parameters */
|
||||||
if(!Source || !Search)
|
if(!Source || !Search)
|
||||||
{
|
{
|
||||||
/* Invalid input parameters, return NULL */
|
/* Invalid input parameters, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if search string is empty */
|
/* Check if search string is empty */
|
||||||
@@ -287,8 +287,8 @@ RTL::WideString::FindWideString(IN PCWSTR Source,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No match found, return NULL */
|
/* No match found, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,8 +315,8 @@ RTL::WideString::FindWideStringInsensitive(IN PCWSTR Source,
|
|||||||
/* Validate input parameters */
|
/* Validate input parameters */
|
||||||
if(!Source || !Search)
|
if(!Source || !Search)
|
||||||
{
|
{
|
||||||
/* Invalid input parameters, return NULL */
|
/* Invalid input parameters, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if search string is empty */
|
/* Check if search string is empty */
|
||||||
@@ -350,8 +350,8 @@ RTL::WideString::FindWideStringInsensitive(IN PCWSTR Source,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No match found, return NULL */
|
/* No match found, return NULLPTR */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -835,8 +835,8 @@ RTL::WideString::FormatArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
|
|||||||
GuidArg = VA_ARG(*ArgumentList, PGUID);
|
GuidArg = VA_ARG(*ArgumentList, PGUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure a pointer to GUID is not NULL */
|
/* Make sure a pointer to GUID is not NULL pointer */
|
||||||
if(GuidArg != NULL)
|
if(GuidArg != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Check if using uppercase format */
|
/* Check if using uppercase format */
|
||||||
if(FormatProperties.Flags & PFL_UPPERCASE)
|
if(FormatProperties.Flags & PFL_UPPERCASE)
|
||||||
@@ -967,7 +967,7 @@ RTL::WideString::FormatArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
|
|||||||
if(Specifier == L'n')
|
if(Specifier == L'n')
|
||||||
{
|
{
|
||||||
/* Make sure, that integer pointer parameter is not NULL */
|
/* Make sure, that integer pointer parameter is not NULL */
|
||||||
if(IntArg != (UINT_PTR)NULL)
|
if(IntArg != (UINT_PTR)NULLPTR)
|
||||||
{
|
{
|
||||||
/* Store number of characters written in integer pointer parameter */
|
/* Store number of characters written in integer pointer parameter */
|
||||||
*((PINT)(UINT_PTR)IntArg) = Context->CharactersWritten;
|
*((PINT)(UINT_PTR)IntArg) = Context->CharactersWritten;
|
||||||
@@ -1031,7 +1031,7 @@ RTL::WideString::FormatArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure a pointer to ANSI_STRING is not NULL */
|
/* Make sure a pointer to ANSI_STRING is not NULL */
|
||||||
if(AnsiStrArg != NULL)
|
if(AnsiStrArg != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Write formatted ANSI string value */
|
/* Write formatted ANSI string value */
|
||||||
Status = WriteStringValue(Context, &FormatProperties, AnsiStrArg->Buffer, AnsiStrArg->Length);
|
Status = WriteStringValue(Context, &FormatProperties, AnsiStrArg->Buffer, AnsiStrArg->Length);
|
||||||
@@ -1053,7 +1053,7 @@ RTL::WideString::FormatArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure a pointer to UNICODE_STRING is not NULL */
|
/* Make sure a pointer to UNICODE_STRING is not NULL */
|
||||||
if(UnicodeStrArg != NULL)
|
if(UnicodeStrArg != NULLPTR)
|
||||||
{
|
{
|
||||||
/* Write formatted UNICODE string value */
|
/* Write formatted UNICODE string value */
|
||||||
Status = WriteValue(Context, &FormatProperties, UnicodeStrArg->Buffer, UnicodeStrArg->Length);
|
Status = WriteValue(Context, &FormatProperties, UnicodeStrArg->Buffer, UnicodeStrArg->Length);
|
||||||
@@ -1097,14 +1097,14 @@ RTL::WideString::FormatWideString(IN PRTL_PRINT_CONTEXT Context,
|
|||||||
ULONG Index;
|
ULONG Index;
|
||||||
|
|
||||||
/* Make sure, that we have valid context and write routine */
|
/* Make sure, that we have valid context and write routine */
|
||||||
if(Context == NULL || Context->WriteWideCharacter == NULL)
|
if(Context == NULLPTR || Context->WriteWideCharacter == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Invalid context or write routine not set */
|
/* Invalid context or write routine not set */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check format string pointer */
|
/* Check format string pointer */
|
||||||
if(Format == NULL)
|
if(Format == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Write null string */
|
/* Write null string */
|
||||||
Format = L"(null)";
|
Format = L"(null)";
|
||||||
@@ -1278,18 +1278,18 @@ RTL::WideString::ReverseWideString(IN OUT PWCHAR String,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the next token in a null-terminated wide string.
|
* Finds the next token in a NULL-terminated wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to tokenize.
|
* Pointer to the NULL-terminated wide string to tokenize.
|
||||||
*
|
*
|
||||||
* @param Delimiter
|
* @param Delimiter
|
||||||
* Pointer to the null-terminated wide string identifying delimiters.
|
* Pointer to the NULL-terminated wide string identifying delimiters.
|
||||||
*
|
*
|
||||||
* @param SavePtr
|
* @param SavePtr
|
||||||
* Pointer to an object used to store routine internal state.
|
* Pointer to an object used to store routine internal state.
|
||||||
*
|
*
|
||||||
* @return Pointer to the beginning of the next token or NULL if there are no more tokens.
|
* @return Pointer to the beginning of the next token or NULLPTR if there are no more tokens.
|
||||||
*
|
*
|
||||||
* @since: XT 1.0
|
* @since: XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -1303,18 +1303,18 @@ RTL::WideString::TokenizeWideString(IN PWCHAR String,
|
|||||||
WCHAR Char, SpanChar;
|
WCHAR Char, SpanChar;
|
||||||
|
|
||||||
/* Check if there is anything to tokenize */
|
/* Check if there is anything to tokenize */
|
||||||
if(String == NULL && (String = *SavePtr) == NULL)
|
if(String == NULLPTR && (String = *SavePtr) == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Empty string given */
|
/* Empty string given */
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check non-delimiter characters */
|
/* Check non-delimiter characters */
|
||||||
Char = *String++;
|
Char = *String++;
|
||||||
if(Char == L'\0')
|
if(Char == L'\0')
|
||||||
{
|
{
|
||||||
*SavePtr = nullptr;
|
*SavePtr = NULLPTR;
|
||||||
return nullptr;
|
return NULLPTR;
|
||||||
}
|
}
|
||||||
Token = String - 1;
|
Token = String - 1;
|
||||||
|
|
||||||
@@ -1332,7 +1332,7 @@ RTL::WideString::TokenizeWideString(IN PWCHAR String,
|
|||||||
if(Char == L'\0')
|
if(Char == L'\0')
|
||||||
{
|
{
|
||||||
/* End of string reached, no more tokens */
|
/* End of string reached, no more tokens */
|
||||||
String = nullptr;
|
String = NULLPTR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1405,7 +1405,7 @@ RTL::WideString::ToUpperWideCharacter(IN WCHAR Character)
|
|||||||
* Removes certain characters from a beginning of the wide string.
|
* Removes certain characters from a beginning of the wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be trimmed.
|
* Pointer to the NULL-terminated wide string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the left-trimmed wide string.
|
* @return This routine returns a pointer to the left-trimmed wide string.
|
||||||
*
|
*
|
||||||
@@ -1435,7 +1435,7 @@ RTL::WideString::TrimLeftWideString(IN PWCHAR String)
|
|||||||
* Removes certain characters from the end of the wide string.
|
* Removes certain characters from the end of the wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be trimmed.
|
* Pointer to the NULL-terminated wide string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the right-trimmed wide string.
|
* @return This routine returns a pointer to the right-trimmed wide string.
|
||||||
*
|
*
|
||||||
@@ -1469,7 +1469,7 @@ RTL::WideString::TrimRightWideString(IN PWCHAR String)
|
|||||||
* Removes certain characters from the beginning and the end of the wide string.
|
* Removes certain characters from the beginning and the end of the wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be trimmed.
|
* Pointer to the NULL-terminated wide string to be trimmed.
|
||||||
*
|
*
|
||||||
* @return This routine returns a pointer to the trimmed wide string.
|
* @return This routine returns a pointer to the trimmed wide string.
|
||||||
*
|
*
|
||||||
@@ -1486,12 +1486,12 @@ RTL::WideString::TrimWideString(IN PWCHAR String)
|
|||||||
* Calculates the length of a given wide string.
|
* Calculates the length of a given wide string.
|
||||||
*
|
*
|
||||||
* @param String
|
* @param String
|
||||||
* Pointer to the null-terminated wide string to be examined.
|
* Pointer to the NULL-terminated wide string to be examined.
|
||||||
*
|
*
|
||||||
* @param MaxLength
|
* @param MaxLength
|
||||||
* Maximum number of wide characters to examine. If no limit set, it examines whole string.
|
* Maximum number of wide characters to examine. If no limit set, it examines whole string.
|
||||||
*
|
*
|
||||||
* @return The length of the null-terminated wide string.
|
* @return The length of the NULL-terminated wide string.
|
||||||
*
|
*
|
||||||
* @since: XT 1.0
|
* @since: XT 1.0
|
||||||
*/
|
*/
|
||||||
@@ -1503,7 +1503,7 @@ RTL::WideString::WideStringLength(IN PCWSTR String,
|
|||||||
SIZE_T Length;
|
SIZE_T Length;
|
||||||
|
|
||||||
/* Check if NULL pointer passed */
|
/* Check if NULL pointer passed */
|
||||||
if(String == NULL)
|
if(String == NULLPTR)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2876,7 +2876,7 @@ RTL::WideString::WriteStringValue(PRTL_PRINT_CONTEXT Context,
|
|||||||
XTSTATUS Status;
|
XTSTATUS Status;
|
||||||
|
|
||||||
/* Check for NULL string */
|
/* Check for NULL string */
|
||||||
if(String == NULL)
|
if(String == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Print '(null)' instead */
|
/* Print '(null)' instead */
|
||||||
String = "(null)";
|
String = "(null)";
|
||||||
@@ -2985,7 +2985,7 @@ RTL::WideString::WriteValue(PRTL_PRINT_CONTEXT Context,
|
|||||||
XTSTATUS Status;
|
XTSTATUS Status;
|
||||||
|
|
||||||
/* Check for NULL string */
|
/* Check for NULL string */
|
||||||
if(String == NULL)
|
if(String == NULLPTR)
|
||||||
{
|
{
|
||||||
/* Print '(null)' instead */
|
/* Print '(null)' instead */
|
||||||
String = L"(null)";
|
String = L"(null)";
|
||||||
|
Reference in New Issue
Block a user