typedef struct _CM_PNP_BIOS_DEVICE_NODE
{
USHORT Size;
- UCHAR Node;
+ CHAR Node;
ULONG ProductId;
- UCHAR DeviceType[3];
+ CHAR DeviceType[3];
USHORT DeviceAttributes;
} __attribute__((packed)) CM_PNP_BIOS_DEVICE_NODE, *PCM_PNP_BIOS_DEVICE_NODE;
Error = RegSetValue(ComponentKey,
"Component Information",
REG_BINARY,
- (PUCHAR)&CompInfo,
+ (PCHAR)&CompInfo,
sizeof(CM_COMPONENT_INFORMATION));
if (Error != ERROR_SUCCESS)
{
LONG Error;
InstData = (PCM_PNP_BIOS_INSTALLATION_CHECK)PnpBiosSupported();
- if (InstData == NULL || strncmp(InstData->Signature, "$PnP", 4))
+ if (InstData == NULL || strncmp((CHAR*)InstData->Signature, "$PnP", 4))
{
DbgPrint((DPRINT_HWDETECT, "PnP-BIOS not supported\n"));
return;
Error = RegSetValue(BusKey,
"Identifier",
REG_SZ,
- (PUCHAR)"PNP BIOS",
+ "PNP BIOS",
9);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(BusKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(DiskKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
ULONG i;
ULONG Checksum;
ULONG Signature;
- char Identifier[20];
+ CHAR Identifier[20];
LONG Error;
/* Read the MBR */
Error = RegSetValue(DiskKey,
"Identifier",
REG_SZ,
- (PUCHAR) Identifier,
+ Identifier,
20);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(SystemKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(PeripheralKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(PeripheralKey,
"Identifier",
REG_SZ,
- (PUCHAR)Identifier,
+ (PCHAR)Identifier,
strlen(Identifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(ControllerKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(PeripheralKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR)&FullResourceDescriptor,
+ (PCHAR)&FullResourceDescriptor,
sizeof(CM_FULL_RESOURCE_DESCRIPTOR) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
if (Error != ERROR_SUCCESS)
Error = RegSetValue(PeripheralKey,
"Identifier",
REG_SZ,
- (PUCHAR)Identifier,
+ Identifier,
strlen(Identifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(ControllerKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(ControllerKey,
"Identifier",
REG_SZ,
- (PUCHAR)Buffer,
+ Buffer,
strlen(Buffer) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(ControllerKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(ControllerKey,
"Identifier",
REG_SZ,
- (PUCHAR)Buffer,
+ Buffer,
strlen(Buffer) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(PeripheralKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR)FullResourceDescriptor,
+ (PCHAR)FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(ControllerKey,
"Identifier",
REG_SZ,
- (PUCHAR)Buffer,
+ Buffer,
strlen(Buffer) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(ControllerKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR)FullResourceDescriptor,
+ (PCHAR)FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(ControllerKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR)&FullResourceDescriptor,
+ (PCHAR)&FullResourceDescriptor,
sizeof(CM_FULL_RESOURCE_DESCRIPTOR));
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(PeripheralKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR)&FullResourceDescriptor,
+ (PCHAR)&FullResourceDescriptor,
sizeof(CM_FULL_RESOURCE_DESCRIPTOR) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
if (Error != ERROR_SUCCESS)
Error = RegSetValue(PeripheralKey,
"Identifier",
REG_SZ,
- (PUCHAR)"MICROSOFT PS2 MOUSE",
+ "MICROSOFT PS2 MOUSE",
20);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(ControllerKey,
"Identifier",
REG_SZ,
- (PUCHAR)Buffer,
+ Buffer,
strlen(Buffer) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(BusKey,
"Identifier",
REG_SZ,
- (PUCHAR)"ISA",
+ "ISA",
4);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(BusKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(BiosKey,
"Identifier",
REG_SZ,
- (PUCHAR)"ACPI BIOS",
+ "ACPI BIOS",
10);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(BiosKey,
"Identifier",
REG_SZ,
- (PUCHAR)"APM",
+ "APM",
4);
if (Error != ERROR_SUCCESS)
{
DetectCPU(FRLDRHKEY CpuKey,
FRLDRHKEY FpuKey)
{
- char VendorIdentifier[13];
- char Identifier[64];
+ CHAR VendorIdentifier[13];
+ CHAR Identifier[64];
ULONG FeatureSet;
FRLDRHKEY CpuInstKey;
FRLDRHKEY FpuInstKey;
Error = RegSetValue(CpuInstKey,
"FeatureSet",
REG_DWORD,
- (PUCHAR)&FeatureSet,
+ (PCHAR)&FeatureSet,
sizeof(ULONG));
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"Identifier",
REG_SZ,
- (PUCHAR)Identifier,
+ Identifier,
strlen(Identifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(FpuInstKey,
"Identifier",
REG_SZ,
- (PUCHAR)Identifier,
+ Identifier,
strlen(Identifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"VendorIdentifier",
REG_SZ,
- (PUCHAR)VendorIdentifier,
+ VendorIdentifier,
strlen(VendorIdentifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"~MHz",
REG_DWORD,
- (PUCHAR)&CpuSpeed,
+ (PCHAR)&CpuSpeed,
sizeof(ULONG));
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"FeatureSet",
REG_DWORD,
- (PUCHAR)&FeatureSet,
+ (PCHAR)&FeatureSet,
sizeof(ULONG));
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"Identifier",
REG_SZ,
- (PUCHAR)Identifier,
+ Identifier,
strlen(Identifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(FpuInstKey,
"Identifier",
REG_SZ,
- (PUCHAR)Identifier,
+ Identifier,
strlen(Identifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"VendorIdentifier",
REG_SZ,
- (PUCHAR)VendorIdentifier,
+ VendorIdentifier,
strlen(VendorIdentifier) + 1);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(CpuInstKey,
"~MHz",
REG_DWORD,
- (PUCHAR)&CpuSpeed,
+ (PCHAR)&CpuSpeed,
sizeof(ULONG));
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(TableKey,
"Identifier",
REG_SZ,
- (PUCHAR)"PCI Real-mode IRQ Routing Table",
+ "PCI Real-mode IRQ Routing Table",
32);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(TableKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
Error = RegSetValue(BiosKey,
"Identifier",
REG_SZ,
- (PUCHAR)"PCI BIOS",
+ "PCI BIOS",
9);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue(BiosKey,
"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- (PUCHAR) FullResourceDescriptor,
+ (PCHAR) FullResourceDescriptor,
Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
VOID RunLoader(VOID)
{
- UCHAR SettingName[80];
- UCHAR SettingValue[80];
+ CHAR SettingName[80];
+ CHAR SettingValue[80];
ULONG SectionId;
ULONG OperatingSystemCount;
- PUCHAR *OperatingSystemSectionNames;
- PUCHAR *OperatingSystemDisplayNames;
+ PCHAR *OperatingSystemSectionNames;
+ PCHAR *OperatingSystemDisplayNames;
ULONG DefaultOperatingSystem;
LONG TimeOut;
ULONG SelectedOperatingSystem;
return;
}
-ULONG GetDefaultOperatingSystem(PUCHAR OperatingSystemList[], ULONG OperatingSystemCount)
+ULONG GetDefaultOperatingSystem(PCHAR OperatingSystemList[], ULONG OperatingSystemCount)
{
- UCHAR DefaultOSText[80];
- char* DefaultOSName;
+ CHAR DefaultOSText[80];
+ PCHAR DefaultOSName;
ULONG SectionId;
ULONG DefaultOS = 0;
ULONG Idx;
LONG GetTimeOut(VOID)
{
- UCHAR TimeOutText[20];
+ CHAR TimeOutText[20];
LONG TimeOut;
ULONG SectionId;
#include <machine.h>
-UCHAR BootDrivePrompt[] = "Enter the boot drive.\n\nExamples:\nfd0 - first floppy drive\nhd0 - first hard drive\nhd1 - second hard drive\ncd0 - first CD-ROM drive.\n\nBIOS drive numbers may also be used:\n0 - first floppy drive\n0x80 - first hard drive\n0x81 - second hard drive";
-UCHAR BootPartitionPrompt[] = "Enter the boot partition.\n\nEnter 0 for the active (bootable) partition.";
-UCHAR BootSectorFilePrompt[] = "Enter the boot sector file path.\n\nExamples:\n\\BOOTSECT.DOS\n/boot/bootsect.dos";
-UCHAR LinuxKernelPrompt[] = "Enter the Linux kernel image path.\n\nExamples:\n/vmlinuz\n/boot/vmlinuz-2.4.18";
-UCHAR LinuxInitrdPrompt[] = "Enter the initrd image path.\n\nExamples:\n/initrd.gz\n/boot/root.img.gz\n\nLeave blank for no initial ram disk.";
-UCHAR LinuxCommandLinePrompt[] = "Enter the Linux kernel command line.\n\nExamples:\nroot=/dev/hda1\nroot=/dev/fd0 read-only\nroot=/dev/sdb1 init=/sbin/init";
-UCHAR ReactOSSystemPathPrompt[] = "Enter the path to your ReactOS system directory.\n\nExamples:\n\\REACTOS\n\\ROS";
-UCHAR ReactOSOptionsPrompt[] = "Enter the options you want passed to the kernel.\n\nExamples:\n/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200\n/FASTDETECT /SOS /NOGUIBOOT\n/BASEVIDEO /MAXMEM=64\n/KERNEL=NTKRNLMP.EXE /HAL=HALMPS.DLL";
+CHAR BootDrivePrompt[] = "Enter the boot drive.\n\nExamples:\nfd0 - first floppy drive\nhd0 - first hard drive\nhd1 - second hard drive\ncd0 - first CD-ROM drive.\n\nBIOS drive numbers may also be used:\n0 - first floppy drive\n0x80 - first hard drive\n0x81 - second hard drive";
+CHAR BootPartitionPrompt[] = "Enter the boot partition.\n\nEnter 0 for the active (bootable) partition.";
+CHAR BootSectorFilePrompt[] = "Enter the boot sector file path.\n\nExamples:\n\\BOOTSECT.DOS\n/boot/bootsect.dos";
+CHAR LinuxKernelPrompt[] = "Enter the Linux kernel image path.\n\nExamples:\n/vmlinuz\n/boot/vmlinuz-2.4.18";
+CHAR LinuxInitrdPrompt[] = "Enter the initrd image path.\n\nExamples:\n/initrd.gz\n/boot/root.img.gz\n\nLeave blank for no initial ram disk.";
+CHAR LinuxCommandLinePrompt[] = "Enter the Linux kernel command line.\n\nExamples:\nroot=/dev/hda1\nroot=/dev/fd0 read-only\nroot=/dev/sdb1 init=/sbin/init";
+CHAR ReactOSSystemPathPrompt[] = "Enter the path to your ReactOS system directory.\n\nExamples:\n\\REACTOS\n\\ROS";
+CHAR ReactOSOptionsPrompt[] = "Enter the options you want passed to the kernel.\n\nExamples:\n/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200\n/FASTDETECT /SOS /NOGUIBOOT\n/BASEVIDEO /MAXMEM=64\n/KERNEL=NTKRNLMP.EXE /HAL=HALMPS.DLL";
-UCHAR CustomBootPrompt[] = "Press ENTER to boot your custom boot setup.";
+CHAR CustomBootPrompt[] = "Press ENTER to boot your custom boot setup.";
VOID OptionMenuCustomBoot(VOID)
{
- PUCHAR CustomBootMenuList[] = { "Disk", "Partition", "Boot Sector File", "ReactOS", "Linux" };
+ PCHAR CustomBootMenuList[] = { "Disk", "Partition", "Boot Sector File", "ReactOS", "Linux" };
ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
ULONG SelectedMenuItem;
VOID OptionMenuCustomBootDisk(VOID)
{
- UCHAR SectionName[100];
- UCHAR BootDriveString[20];
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
ULONG SectionId;
ULONG Year, Month, Day, Hour, Minute, Second;
VOID OptionMenuCustomBootPartition(VOID)
{
- UCHAR SectionName[100];
- UCHAR BootDriveString[20];
- UCHAR BootPartitionString[20];
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
+ CHAR BootPartitionString[20];
ULONG SectionId;
ULONG Year, Month, Day, Hour, Minute, Second;
VOID OptionMenuCustomBootBootSectorFile(VOID)
{
- UCHAR SectionName[100];
- UCHAR BootDriveString[20];
- UCHAR BootPartitionString[20];
- UCHAR BootSectorFileString[200];
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
+ CHAR BootPartitionString[20];
+ CHAR BootSectorFileString[200];
ULONG SectionId;
ULONG Year, Month, Day, Hour, Minute, Second;
VOID OptionMenuCustomBootReactOS(VOID)
{
- UCHAR SectionName[100];
- UCHAR BootDriveString[20];
- UCHAR BootPartitionString[20];
- UCHAR ReactOSSystemPath[200];
- UCHAR ReactOSARCPath[200];
- UCHAR ReactOSOptions[200];
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
+ CHAR BootPartitionString[20];
+ CHAR ReactOSSystemPath[200];
+ CHAR ReactOSARCPath[200];
+ CHAR ReactOSOptions[200];
ULONG SectionId;
ULONG Year, Month, Day, Hour, Minute, Second;
VOID OptionMenuCustomBootLinux(VOID)
{
- UCHAR SectionName[100];
- UCHAR BootDriveString[20];
- UCHAR BootPartitionString[20];
- UCHAR LinuxKernelString[200];
- UCHAR LinuxInitrdString[200];
- UCHAR LinuxCommandLineString[200];
+ CHAR SectionName[100];
+ CHAR BootDriveString[20];
+ CHAR BootPartitionString[20];
+ CHAR LinuxKernelString[200];
+ CHAR LinuxInitrdString[200];
+ CHAR LinuxCommandLineString[200];
ULONG SectionId;
ULONG Year, Month, Day, Hour, Minute, Second;
bReportError = bError;
}
-VOID DiskError(PUCHAR ErrorString, ULONG ErrorCode)
+VOID DiskError(PCHAR ErrorString, ULONG ErrorCode)
{
- UCHAR ErrorCodeString[200];
+ CHAR ErrorCodeString[200];
if (bReportError == FALSE)
return;
UiMessageBox(ErrorCodeString);
}
-PUCHAR DiskGetErrorCodeString(ULONG ErrorCode)
+PCHAR DiskGetErrorCodeString(ULONG ErrorCode)
{
switch (ErrorCode)
{
ULONG DriveMapHandlerAddress = 0; // Linear address of our drive map handler
ULONG DriveMapHandlerSegOff = 0; // Segment:offset style address of our drive map handler
-VOID DriveMapMapDrivesInSection(PUCHAR SectionName)
+VOID DriveMapMapDrivesInSection(PCHAR SectionName)
{
- UCHAR SettingName[80];
- UCHAR SettingValue[80];
- UCHAR ErrorText[260];
- UCHAR Drive1[80];
- UCHAR Drive2[80];
+ CHAR SettingName[80];
+ CHAR SettingValue[80];
+ CHAR ErrorText[260];
+ CHAR Drive1[80];
+ CHAR Drive2[80];
ULONG SectionId;
ULONG SectionItemCount;
ULONG Index;
}
}
-BOOL DriveMapIsValidDriveString(PUCHAR DriveString)
+BOOL DriveMapIsValidDriveString(PCHAR DriveString)
{
ULONG Index;
return TRUE;
}
-ULONG DriveMapGetBiosDriveNumber(PUCHAR DeviceName)
+ULONG DriveMapGetBiosDriveNumber(PCHAR DeviceName)
{
ULONG BiosDriveNumber = 0;
* Tries to open the file 'name' and returns true or false
* for success and failure respectively
*/
-FILE* Ext2OpenFile(PUCHAR FileName)
+FILE* Ext2OpenFile(PCHAR FileName)
{
EXT2_FILE_INFO TempExt2FileInfo;
PEXT2_FILE_INFO FileHandle;
- UCHAR SymLinkPath[EXT3_NAME_LEN];
- UCHAR FullPath[EXT3_NAME_LEN * 2];
+ CHAR SymLinkPath[EXT3_NAME_LEN];
+ CHAR FullPath[EXT3_NAME_LEN * 2];
ULONG Index;
DbgPrint((DPRINT_FILESYSTEM, "Ext2OpenFile() FileName = %s\n", FileName));
* with info describing the file, etc. returns true
* if the file exists or false otherwise
*/
-BOOL Ext2LookupFile(PUCHAR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer)
+BOOL Ext2LookupFile(PCHAR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer)
{
int i;
ULONG NumberOfPathParts;
- UCHAR PathPart[261];
+ CHAR PathPart[261];
PVOID DirectoryBuffer;
ULONG DirectoryInode = EXT3_ROOT_INO;
EXT2_INODE InodeData;
return TRUE;
}
-BOOL Ext2SearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PUCHAR FileName, PEXT2_DIR_ENTRY DirectoryEntry)
+BOOL Ext2SearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PCHAR FileName, PEXT2_DIR_ENTRY DirectoryEntry)
{
ULONG CurrentOffset;
PEXT2_DIR_ENTRY CurrentDirectoryEntry;
BOOL Ext2ReadBlock(ULONG BlockNumber, PVOID Buffer)
{
- UCHAR ErrorString[80];
+ CHAR ErrorString[80];
DbgPrint((DPRINT_FILESYSTEM, "Ext2ReadBlock() BlockNumber = %d Buffer = 0x%x\n", BlockNumber, Buffer));
ULONG InodeGroupNumber;
ULONG InodeBlockNumber;
ULONG InodeOffsetInBlock;
- UCHAR ErrorString[80];
+ CHAR ErrorString[80];
EXT2_GROUP_DESC GroupDescriptor;
DbgPrint((DPRINT_FILESYSTEM, "Ext2ReadInode() Inode = %d\n", Inode));
ULONG inode; /* Inode number */
USHORT rec_len; /* Directory entry length */
USHORT name_len; /* Name length */
- char name[EXT3_NAME_LEN]; /* File name */
+ CHAR name[EXT3_NAME_LEN]; /* File name */
};
/*
USHORT rec_len; /* Directory entry length */
UCHAR name_len; /* Name length */
UCHAR file_type;
- char name[EXT3_NAME_LEN]; /* File name */
+ CHAR name[EXT3_NAME_LEN]; /* File name */
};
/*
BOOL Ext2OpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector);
-FILE* Ext2OpenFile(PUCHAR FileName);
-BOOL Ext2LookupFile(PUCHAR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer);
-BOOL Ext2SearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PUCHAR FileName, PEXT2_DIR_ENTRY DirectoryEntry);
+FILE* Ext2OpenFile(PCHAR FileName);
+BOOL Ext2LookupFile(PCHAR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer);
+BOOL Ext2SearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PCHAR FileName, PEXT2_DIR_ENTRY DirectoryEntry);
BOOL Ext2ReadFile(FILE *FileHandle, ULONGLONG BytesToRead, ULONGLONG* BytesRead, PVOID Buffer);
ULONGLONG Ext2GetFileSize(FILE *FileHandle);
VOID Ext2SetFilePointer(FILE *FileHandle, ULONGLONG NewFilePointer);
return DirectoryBuffer;
}
-BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
+BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
{
ULONG EntryCount;
ULONG CurrentEntry;
PDIRENTRY DirEntry;
PLFN_DIRENTRY LfnDirEntry;
- UCHAR LfnNameBuffer[265];
- UCHAR ShortNameBuffer[20];
+ CHAR LfnNameBuffer[265];
+ CHAR ShortNameBuffer[20];
ULONG StartCluster;
EntryCount = DirectorySize / sizeof(DIRENTRY);
DbgPrint((DPRINT_FILESYSTEM, "FatSearchDirectoryBufferForFile() DirectoryBuffer = 0x%x EntryCount = %d FileName = %s\n", DirectoryBuffer, EntryCount, FileName));
- memset(ShortNameBuffer, 0, 13 * sizeof(UCHAR));
- memset(LfnNameBuffer, 0, 261 * sizeof(UCHAR));
+ memset(ShortNameBuffer, 0, 13 * sizeof(CHAR));
+ memset(LfnNameBuffer, 0, 261 * sizeof(CHAR));
DirEntry = (PDIRENTRY) DirectoryBuffer;
for (CurrentEntry=0; CurrentEntry<EntryCount; CurrentEntry++, DirEntry++)
// entries after this one are unused. If this is the
// last entry then we didn't find the file in this directory.
//
- if (DirEntry->FileName[0] == 0x00)
+ if (DirEntry->FileName[0] == '\0')
{
return FALSE;
}
//
// Check if this is a deleted entry or not
//
- if (DirEntry->FileName[0] == 0xE5)
+ if (DirEntry->FileName[0] == '\xE5')
{
- memset(ShortNameBuffer, 0, 13 * sizeof(UCHAR));
- memset(LfnNameBuffer, 0, 261 * sizeof(UCHAR));
+ memset(ShortNameBuffer, 0, 13 * sizeof(CHAR));
+ memset(LfnNameBuffer, 0, 261 * sizeof(CHAR));
continue;
}
return FALSE;
}
-BOOL FatXSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
+BOOL FatXSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectorySize, PCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
{
ULONG EntryCount;
ULONG CurrentEntry;
* with info describing the file, etc. returns true
* if the file exists or false otherwise
*/
-BOOL FatLookupFile(PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
+BOOL FatLookupFile(PCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
{
int i;
ULONG NumberOfPathParts;
- UCHAR PathPart[261];
+ CHAR PathPart[261];
PVOID DirectoryBuffer;
ULONG DirectoryStartCluster = 0;
ULONG DirectorySize;
* is in the form of "FILE EXT" and puts it in Buffer
* in the form of "file.ext"
*/
-void FatParseShortFileName(PUCHAR Buffer, PDIRENTRY DirEntry)
+void FatParseShortFileName(PCHAR Buffer, PDIRENTRY DirEntry)
{
ULONG Idx;
* Tries to open the file 'name' and returns true or false
* for success and failure respectively
*/
-FILE* FatOpenFile(PUCHAR FileName)
+FILE* FatOpenFile(PCHAR FileName)
{
FAT_FILE_INFO TempFatFileInfo;
PFAT_FILE_INFO FileHandle;
typedef struct _FAT_BOOTSECTOR
{
UCHAR JumpBoot[3]; // Jump instruction to boot code
- UCHAR OemName[8]; // "MSWIN4.1" for MS formatted volumes
+ CHAR OemName[8]; // "MSWIN4.1" for MS formatted volumes
USHORT BytesPerSector; // Bytes per sector
UCHAR SectorsPerCluster; // Number of sectors in a cluster
USHORT ReservedSectors; // Reserved sectors, usually 1 (the bootsector)
UCHAR Reserved1; // Reserved (used by Windows NT). Code that formats FAT volumes should always set this byte to 0.
UCHAR BootSignature; // Extended boot signature (0x29). This is a signature byte that indicates that the following three fields in the boot sector are present.
ULONG VolumeSerialNumber; // Volume serial number
- UCHAR VolumeLabel[11]; // Volume label. This field matches the 11-byte volume label recorded in the root directory
- UCHAR FileSystemType[8]; // One of the strings "FAT12 ", "FAT16 ", or "FAT "
+ CHAR VolumeLabel[11]; // Volume label. This field matches the 11-byte volume label recorded in the root directory
+ CHAR FileSystemType[8]; // One of the strings "FAT12 ", "FAT16 ", or "FAT "
UCHAR BootCodeAndData[448]; // The remainder of the boot sector
typedef struct _FAT32_BOOTSECTOR
{
UCHAR JumpBoot[3]; // Jump instruction to boot code
- UCHAR OemName[8]; // "MSWIN4.1" for MS formatted volumes
+ CHAR OemName[8]; // "MSWIN4.1" for MS formatted volumes
USHORT BytesPerSector; // Bytes per sector
UCHAR SectorsPerCluster; // Number of sectors in a cluster
USHORT ReservedSectors; // Reserved sectors, usually 1 (the bootsector)
UCHAR Reserved1; // Reserved (used by Windows NT). Code that formats FAT volumes should always set this byte to 0.
UCHAR BootSignature; // Extended boot signature (0x29). This is a signature byte that indicates that the following three fields in the boot sector are present.
ULONG VolumeSerialNumber; // Volume serial number
- UCHAR VolumeLabel[11]; // Volume label. This field matches the 11-byte volume label recorded in the root directory
- UCHAR FileSystemType[8]; // Always set to the string "FAT32 "
+ CHAR VolumeLabel[11]; // Volume label. This field matches the 11-byte volume label recorded in the root directory
+ CHAR FileSystemType[8]; // Always set to the string "FAT32 "
UCHAR BootCodeAndData[420]; // The remainder of the boot sector
typedef struct _FATX_BOOTSECTOR
{
- UCHAR FileSystemType[4]; /* String "FATX" */
+ CHAR FileSystemType[4]; /* String "FATX" */
ULONG VolumeSerialNumber; /* Volume serial number */
ULONG SectorsPerCluster; /* Number of sectors in a cluster */
USHORT NumberOfFats; /* Number of FAT tables */
*/
typedef struct //_DIRENTRY
{
- UCHAR FileName[11]; /* Filename + extension */
+ CHAR FileName[11]; /* Filename + extension */
UCHAR Attr; /* File attributes */
UCHAR ReservedNT; /* Reserved for use by Windows NT */
UCHAR TimeInTenths; /* Millisecond stamp at file creation */
{
UCHAR FileNameSize; /* Size of filename (max 42) */
UCHAR Attr; /* File attributes */
- UCHAR FileName[42]; /* Filename in ASCII, padded with 0xff (not zero-terminated) */
+ CHAR FileName[42]; /* Filename in ASCII, padded with 0xff (not zero-terminated) */
ULONG StartCluster; /* Starting cluster number */
ULONG Size; /* File size */
USHORT Time; /* Time last modified */
BOOL FatOpenVolume(ULONG DriveNumber, ULONG VolumeStartSector, ULONG PartitionSectorCount);
ULONG FatDetermineFatType(PFAT_BOOTSECTOR FatBootSector, ULONG PartitionSectorCount);
PVOID FatBufferDirectory(ULONG DirectoryStartCluster, ULONG* EntryCountPointer, BOOL RootDirectory);
-BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG EntryCount, PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer);
-BOOL FatLookupFile(PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer);
-void FatParseShortFileName(PUCHAR Buffer, PDIRENTRY DirEntry);
+BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG EntryCount, PCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer);
+BOOL FatLookupFile(PCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer);
+void FatParseShortFileName(PCHAR Buffer, PDIRENTRY DirEntry);
BOOL FatGetFatEntry(ULONG Cluster, ULONG* ClusterPointer);
-FILE* FatOpenFile(PUCHAR FileName);
+FILE* FatOpenFile(PCHAR FileName);
ULONG FatCountClustersInChain(ULONG StartCluster);
ULONG* FatGetClusterChainArray(ULONG StartCluster);
BOOL FatReadCluster(ULONG ClusterNumber, PVOID Buffer);
// FUNCTIONS
/////////////////////////////////////////////////////////////////////////////////////////////
-VOID FileSystemError(PUCHAR ErrorString)
+VOID FileSystemError(PCHAR ErrorString)
{
DbgPrint((DPRINT_FILESYSTEM, "%s\n", ErrorString));
*/
static BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type)
{
- UCHAR ErrorText[80];
+ CHAR ErrorText[80];
FsType = Type;
}
-PFILE FsOpenFile(PUCHAR FileName)
+PFILE FsOpenFile(PCHAR FileName)
{
PFILE FileHandle = NULL;
* This function parses a path in the form of dir1\dir2\file1.ext
* and returns the number of parts it has (i.e. 3 - dir1,dir2,file1.ext)
*/
-ULONG FsGetNumPathParts(PUCHAR Path)
+ULONG FsGetNumPathParts(PCHAR Path)
{
ULONG i;
ULONG num;
* and puts the first name of the path (e.g. "dir1") in buffer
* compatible with the MSDOS directory structure
*/
-VOID FsGetFirstNameFromPath(PUCHAR Buffer, PUCHAR Path)
+VOID FsGetFirstNameFromPath(PCHAR Buffer, PCHAR Path)
{
ULONG i;
}
-static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectoryLength, PUCHAR FileName, PISO_FILE_INFO IsoFileInfoPointer)
+static BOOL IsoSearchDirectoryBufferForFile(PVOID DirectoryBuffer, ULONG DirectoryLength, PCHAR FileName, PISO_FILE_INFO IsoFileInfoPointer)
{
PDIR_RECORD Record;
ULONG Offset;
ULONG i;
- UCHAR Name[32];
+ CHAR Name[32];
DbgPrint((DPRINT_FILESYSTEM, "IsoSearchDirectoryBufferForFile() DirectoryBuffer = 0x%x DirectoryLength = %d FileName = %s\n", DirectoryBuffer, DirectoryLength, FileName));
* with info describing the file, etc. returns true
* if the file exists or false otherwise
*/
-static BOOL IsoLookupFile(PUCHAR FileName, PISO_FILE_INFO IsoFileInfoPointer)
+static BOOL IsoLookupFile(PCHAR FileName, PISO_FILE_INFO IsoFileInfoPointer)
{
int i;
ULONG NumberOfPathParts;
- UCHAR PathPart[261];
+ CHAR PathPart[261];
PVOID DirectoryBuffer;
ULONG DirectorySector;
ULONG DirectoryLength;
* Tries to open the file 'name' and returns true or false
* for success and failure respectively
*/
-FILE* IsoOpenFile(PUCHAR FileName)
+FILE* IsoOpenFile(PCHAR FileName)
{
ISO_FILE_INFO TempFileInfo;
PISO_FILE_INFO FileHandle;
struct _PVD
{
UCHAR VdType; // 1
- UCHAR StandardId[5]; // 2-6
+ CHAR StandardId[5]; // 2-6
UCHAR VdVersion; // 7
UCHAR unused0; // 8
- UCHAR SystemId[32]; // 9-40
- UCHAR VolumeId[32]; // 41-72
+ CHAR SystemId[32]; // 9-40
+ CHAR VolumeId[32]; // 41-72
UCHAR unused1[8]; // 73-80
ULONG VolumeSpaceSizeL; // 81-84
ULONG VolumeSpaceSizeM; // 85-88
ULONG MPathTablePos; // 149-152
ULONG MOptPathTablePos; // 153-156
DIR_RECORD RootDirRecord; // 157-190
- UCHAR VolumeSetIdentifier[128]; // 191-318
- UCHAR PublisherIdentifier[128]; // 319-446
+ CHAR VolumeSetIdentifier[128]; // 191-318
+ CHAR PublisherIdentifier[128]; // 319-446
/* more data ... */
BOOL IsoOpenVolume(ULONG DriveNumber);
-FILE* IsoOpenFile(PUCHAR FileName);
+FILE* IsoOpenFile(PCHAR FileName);
BOOL IsoReadFile(FILE *FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer);
ULONG IsoGetFileSize(FILE *FileHandle);
VOID IsoSetFilePointer(FILE *FileHandle, ULONG NewFilePointer);
return FALSE;
}
-BOOL NtfsLookupFile(PUCHAR FileName, PNTFS_MFT_RECORD MftRecord, PNTFS_ATTR_CONTEXT DataContext)
+BOOL NtfsLookupFile(PCHAR FileName, PNTFS_MFT_RECORD MftRecord, PNTFS_ATTR_CONTEXT DataContext)
{
ULONG NumberOfPathParts;
- UCHAR PathPart[261];
+ CHAR PathPart[261];
ULONG CurrentMFTIndex;
UCHAR i;
return TRUE;
}
-FILE* NtfsOpenFile(PUCHAR FileName)
+FILE* NtfsOpenFile(PCHAR FileName)
{
PNTFS_FILE_HANDLE FileHandle;
PNTFS_MFT_RECORD MftRecord;
typedef struct
{
UCHAR JumpBoot[3]; // Jump to the boot loader routine
- UCHAR SystemId[8]; // System Id ("NTFS ")
+ CHAR SystemId[8]; // System Id ("NTFS ")
USHORT BytesPerSector; // Bytes per sector
UCHAR SectorsPerCluster; // Number of sectors in a cluster
UCHAR Unused1[7];
} PACKED NTFS_FILE_HANDLE, *PNTFS_FILE_HANDLE;
BOOL NtfsOpenVolume(ULONG DriveNumber, ULONG VolumeStartSector);
-FILE* NtfsOpenFile(PUCHAR FileName);
+FILE* NtfsOpenFile(PCHAR FileName);
BOOL NtfsReadFile(FILE *FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer);
ULONG NtfsGetFileSize(FILE *FileHandle);
VOID NtfsSetFilePointer(FILE *FileHandle, ULONG NewFilePointer);
#define __BOOTMGR_H
-ULONG GetDefaultOperatingSystem(PUCHAR OperatingSystemList[], ULONG OperatingSystemCount);
+ULONG GetDefaultOperatingSystem(PCHAR OperatingSystemList[], ULONG OperatingSystemCount);
LONG GetTimeOut(VOID);
BOOL MainBootMenuKeyPressFilter(ULONG KeyPress);
//
///////////////////////////////////////////////////////////////////////////////////////
VOID DiskReportError (BOOL bError);
-VOID DiskError(PUCHAR ErrorString, ULONG ErrorCode);
-PUCHAR DiskGetErrorCodeString(ULONG ErrorCode);
+VOID DiskError(PCHAR ErrorString, ULONG ErrorCode);
+PCHAR DiskGetErrorCodeString(ULONG ErrorCode);
BOOL DiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); // Implemented in i386disk.c
BOOL DiskIsDriveRemovable(ULONG DriveNumber);
VOID DiskStopFloppyMotor(VOID); // Implemented in i386disk.c
{
UCHAR DriveMapCount; // Count of drives currently mapped
- UCHAR DriveMap[8]; // Map of BIOS drives
+ CHAR DriveMap[8]; // Map of BIOS drives
} PACKED DRIVE_MAP_LIST, *PDRIVE_MAP_LIST;
-VOID DriveMapMapDrivesInSection(PUCHAR SectionName);
-BOOL DriveMapIsValidDriveString(PUCHAR DriveString); // Checks the drive string ("hd0") for validity
-ULONG DriveMapGetBiosDriveNumber(PUCHAR DeviceName); // Returns a BIOS drive number for any given device name (e.g. 0x80 for 'hd0')
+VOID DriveMapMapDrivesInSection(PCHAR SectionName);
+BOOL DriveMapIsValidDriveString(PCHAR DriveString); // Checks the drive string ("hd0") for validity
+ULONG DriveMapGetBiosDriveNumber(PCHAR DeviceName); // Returns a BIOS drive number for any given device name (e.g. 0x80 for 'hd0')
VOID DriveMapInstallInt13Handler(PDRIVE_MAP_LIST DriveMap); // Installs the int 13h handler for the drive mapper
VOID DriveMapRemoveInt13Handler(VOID); // Removes a previously installed int 13h drive map handler
#define FILE VOID
#define PFILE FILE *
-VOID FileSystemError(PUCHAR ErrorString);
+VOID FileSystemError(PCHAR ErrorString);
BOOL FsOpenBootVolume();
-BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG BootDevice);
-PFILE FsOpenFile(PUCHAR FileName);
+BOOL FsOpenSystemVolume(PCHAR SystemPath, PCHAR RemainingPath, PULONG BootDevice);
+PFILE FsOpenFile(PCHAR FileName);
VOID FsCloseFile(PFILE FileHandle);
BOOL FsReadFile(PFILE FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer);
ULONG FsGetFileSize(PFILE FileHandle);
VOID FsSetFilePointer(PFILE FileHandle, ULONG NewFilePointer);
ULONG FsGetFilePointer(PFILE FileHandle);
BOOL FsIsEndOfFile(PFILE FileHandle);
-ULONG FsGetNumPathParts(PUCHAR Path);
-VOID FsGetFirstNameFromPath(PUCHAR Buffer, PUCHAR Path);
+ULONG FsGetNumPathParts(PCHAR Path);
+VOID FsGetFirstNameFromPath(PCHAR Buffer, PCHAR Path);
#endif // #defined __FS_H
BOOL IniFileInitialize(VOID);
-BOOL IniOpenSection(PUCHAR SectionName, ULONG* SectionId);
+BOOL IniOpenSection(PCHAR SectionName, ULONG* SectionId);
ULONG IniGetNumSectionItems(ULONG SectionId);
ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex);
ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex);
-BOOL IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PUCHAR SettingName, ULONG NameSize, PUCHAR SettingValue, ULONG ValueSize);
-BOOL IniReadSettingByName(ULONG SectionId, PUCHAR SettingName, PUCHAR Buffer, ULONG BufferSize);
-BOOL IniAddSection(PUCHAR SectionName, ULONG* SectionId);
-BOOL IniAddSettingValueToSection(ULONG SectionId, PUCHAR SettingName, PUCHAR SettingValue);
+BOOL IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize);
+BOOL IniReadSettingByName(ULONG SectionId, PCHAR SettingName, PCHAR Buffer, ULONG BufferSize);
+BOOL IniAddSection(PCHAR SectionName, ULONG* SectionId);
+BOOL IniAddSettingValueToSection(ULONG SectionId, PCHAR SettingName, PCHAR SettingValue);
#endif // defined __PARSEINI_H
VOID BootNewLinuxKernel(VOID); // Implemented in linux.S
VOID BootOldLinuxKernel(ULONG KernelSize); // Implemented in linux.S
-VOID LoadAndBootLinux(PUCHAR OperatingSystemName, PUCHAR Description);
+VOID LoadAndBootLinux(PCHAR OperatingSystemName, PCHAR Description);
-BOOL LinuxParseIniSection(PUCHAR OperatingSystemName);
+BOOL LinuxParseIniSection(PCHAR OperatingSystemName);
BOOL LinuxReadBootSector(PFILE LinuxKernelFile);
BOOL LinuxReadSetupSector(PFILE LinuxKernelFile);
BOOL LinuxReadKernel(PFILE LinuxKernelFile);
#ifndef __BOOT_H
#define __BOOT_H
-VOID LoadAndBootBootSector(PUCHAR OperatingSystemName);
-VOID LoadAndBootPartition(PUCHAR OperatingSystemName);
-VOID LoadAndBootDrive(PUCHAR OperatingSystemName);
+VOID LoadAndBootBootSector(PCHAR OperatingSystemName);
+VOID LoadAndBootPartition(PCHAR OperatingSystemName);
+VOID LoadAndBootDrive(PCHAR OperatingSystemName);
#endif // defined __BOOT_H
FrLdrSetupPageDirectory(VOID);
VOID
-LoadAndBootReactOS(PUCHAR OperatingSystemName);
+LoadAndBootReactOS(PCHAR OperatingSystemName);
VOID FASTCALL AsmCode(VOID);
typedef VOID (FASTCALL *ASMCODE)(ULONG Magic,
#ifndef __OSLIST_H
#define __OSLIST_H
-BOOL InitOperatingSystemList(PUCHAR **SectionNamesPointer, PUCHAR **DisplayNamesPointer, ULONG* OperatingSystemCountPointer);
+BOOL InitOperatingSystemList(PCHAR **SectionNamesPointer, PCHAR **DisplayNamesPointer, ULONG* OperatingSystemCountPointer);
ULONG CountOperatingSystems(ULONG SectionId);
-BOOL AllocateListMemory(PUCHAR **SectionNamesPointer, PUCHAR **DisplayNamesPointer, ULONG OperatingSystemCount);
-BOOL RemoveQuotes(PUCHAR QuotedString);
+BOOL AllocateListMemory(PCHAR **SectionNamesPointer, PCHAR **DisplayNamesPointer, ULONG OperatingSystemCount);
+BOOL RemoveQuotes(PCHAR QuotedString);
#endif // #defined __OSLIST_H
// ReactOS Loading Functions
//
///////////////////////////////////////////////////////////////////////////////////////
-VOID LoadAndBootReactOS(PUCHAR OperatingSystemName);
+VOID LoadAndBootReactOS(PCHAR OperatingSystemName);
///////////////////////////////////////////////////////////////////////////////////////
//
// ARC Path Functions
//
///////////////////////////////////////////////////////////////////////////////////////
-BOOL DissectArcPath(LPSTR ArcPath, LPSTR BootPath, PULONG BootDrive, PULONG BootPartition);
-VOID ConstructArcPath(PUCHAR ArcPath, PUCHAR SystemFolder, ULONG Disk, ULONG Partition);
-ULONG ConvertArcNameToBiosDriveNumber(PUCHAR ArcPath);
+BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* BootPartition);
+VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, ULONG Disk, ULONG Partition);
+ULONG ConvertArcNameToBiosDriveNumber(PCHAR ArcPath);
#endif // defined __REACTOS_H
extern UCHAR UiEditBoxTextColor; // Edit box text color
extern UCHAR UiEditBoxBgColor; // Edit box text background color
-extern UCHAR UiTitleBoxTitleText[260]; // Title box's title text
+extern CHAR UiTitleBoxTitleText[260]; // Title box's title text
extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed
extern BOOL UiUseSpecialEffects; // Tells us if we should use fade effects
-extern UCHAR UiMonthNames[12][15];
+extern CHAR UiMonthNames[12][15];
///////////////////////////////////////////////////////////////////////////////////////
//
//
///////////////////////////////////////////////////////////////////////////////////////
BOOL UiInitialize(BOOLEAN ShowGui); // Initialize User-Interface
-VOID UiUnInitialize(PUCHAR BootText); // Un-initialize User-Interface
+VOID UiUnInitialize(PCHAR BootText); // Un-initialize User-Interface
VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
-VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
+VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified
-VOID UiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr); // Draws text at coordinates specified
-VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PUCHAR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
-VOID UiDrawStatusText(PUCHAR StatusText); // Draws text at the very bottom line on the screen
+VOID UiDrawText(ULONG X, ULONG Y, PCHAR Text, UCHAR Attr); // Draws text at coordinates specified
+VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCHAR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
+VOID UiDrawStatusText(PCHAR StatusText); // Draws text at the very bottom line on the screen
VOID UiUpdateDateTime(VOID); // Updates the date and time
-VOID UiInfoBox(PUCHAR MessageText); // Displays a info box on the screen
-VOID UiMessageBox(PUCHAR MessageText); // Displays a message box on the screen with an ok button
-VOID UiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
-VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
-VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
-VOID UiShowMessageBoxesInSection(PUCHAR SectionName); // Displays all the message boxes in a given section
-VOID UiEscapeString(PUCHAR String); // Processes a string and changes all occurances of "\n" to '\n'
-BOOL UiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, ULONG Length);
+VOID UiInfoBox(PCHAR MessageText); // Displays a info box on the screen
+VOID UiMessageBox(PCHAR MessageText); // Displays a message box on the screen with an ok button
+VOID UiMessageBoxCritical(PCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
+VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
+VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
+VOID UiShowMessageBoxesInSection(PCHAR SectionName); // Displays all the message boxes in a given section
+VOID UiEscapeString(PCHAR String); // Processes a string and changes all occurances of "\n" to '\n'
+BOOL UiEditBox(PCHAR MessageText, PCHAR EditTextBuffer, ULONG Length);
-UCHAR UiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value
-UCHAR UiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
+UCHAR UiTextToColor(PCHAR ColorText); // Converts the text color into it's equivalent color value
+UCHAR UiTextToFillStyle(PCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
-VOID UiTruncateStringEllipsis(PUCHAR StringText, ULONG MaxChars); // Truncates a string to MaxChars by adding an ellipsis on the end '...'
+VOID UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars); // Truncates a string to MaxChars by adding an ellipsis on the end '...'
VOID UiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
VOID UiFadeOut(VOID); // Fades the screen out
///////////////////////////////////////////////////////////////////////////////////////
typedef BOOL (*UiMenuKeyPressFilterCallback)(ULONG KeyPress);
-BOOL UiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
+BOOL UiDisplayMenu(PCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
#ifndef ASM
-PUCHAR GetFreeLoaderVersionString(VOID);
+PCHAR GetFreeLoaderVersionString(VOID);
#endif // ASM
typedef struct
{
LIST_ITEM ListEntry;
- PUCHAR ItemName;
- PUCHAR ItemValue;
+ PCHAR ItemName;
+ PCHAR ItemValue;
} INI_SECTION_ITEM, *PINI_SECTION_ITEM;
typedef struct
{
LIST_ITEM ListEntry;
- PUCHAR SectionName;
+ PCHAR SectionName;
ULONG SectionItemCount;
PINI_SECTION_ITEM SectionItemList;
PFILE IniOpenIniFile();
-BOOL IniParseFile(PUCHAR IniFileData, ULONG IniFileSize);
-ULONG IniGetNextLineSize(PUCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset);
-ULONG IniGetNextLine(PUCHAR IniFileData, ULONG IniFileSize, PUCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset);
-BOOL IniIsLineEmpty(PUCHAR LineOfText, ULONG TextLength);
-BOOL IniIsCommentLine(PUCHAR LineOfText, ULONG TextLength);
-BOOL IniIsSectionName(PUCHAR LineOfText, ULONG TextLength);
-ULONG IniGetSectionNameSize(PUCHAR SectionNameLine, ULONG LineLength);
-VOID IniExtractSectionName(PUCHAR SectionName, PUCHAR SectionNameLine, ULONG LineLength);
-BOOL IniIsSetting(PUCHAR LineOfText, ULONG TextLength);
-ULONG IniGetSettingNameSize(PUCHAR SettingNameLine, ULONG LineLength);
-ULONG IniGetSettingValueSize(PUCHAR SettingValueLine, ULONG LineLength);
-VOID IniExtractSettingName(PUCHAR SettingName, PUCHAR SettingNameLine, ULONG LineLength);
-VOID IniExtractSettingValue(PUCHAR SettingValue, PUCHAR SettingValueLine, ULONG LineLength);
+BOOL IniParseFile(PCHAR IniFileData, ULONG IniFileSize);
+ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset);
+ULONG IniGetNextLine(PCHAR IniFileData, ULONG IniFileSize, PCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset);
+BOOL IniIsLineEmpty(PCHAR LineOfText, ULONG TextLength);
+BOOL IniIsCommentLine(PCHAR LineOfText, ULONG TextLength);
+BOOL IniIsSectionName(PCHAR LineOfText, ULONG TextLength);
+ULONG IniGetSectionNameSize(PCHAR SectionNameLine, ULONG LineLength);
+VOID IniExtractSectionName(PCHAR SectionName, PCHAR SectionNameLine, ULONG LineLength);
+BOOL IniIsSetting(PCHAR LineOfText, ULONG TextLength);
+ULONG IniGetSettingNameSize(PCHAR SettingNameLine, ULONG LineLength);
+ULONG IniGetSettingValueSize(PCHAR SettingValueLine, ULONG LineLength);
+VOID IniExtractSettingName(PCHAR SettingName, PCHAR SettingNameLine, ULONG LineLength);
+VOID IniExtractSettingValue(PCHAR SettingValue, PCHAR SettingValueLine, ULONG LineLength);
#endif // defined __INI_H
BOOL IniFileInitialize(VOID)
{
PFILE Freeldr_Ini; // File handle for freeldr.ini
- PUCHAR FreeLoaderIniFileData;
+ PCHAR FreeLoaderIniFileData;
ULONG FreeLoaderIniFileSize;
BOOL Success;
#include <debug.h>
#include <mm.h>
-BOOL IniOpenSection(PUCHAR SectionName, ULONG* SectionId)
+BOOL IniOpenSection(PCHAR SectionName, ULONG* SectionId)
{
PINI_SECTION Section;
return (strlen(Section->SectionItemList[SettingIndex].ItemValue) + 1);
}
-BOOL IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PUCHAR SettingName, ULONG NameSize, PUCHAR SettingValue, ULONG ValueSize)
+BOOL IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
PINI_SECTION_ITEM SectionItem;
return FALSE;
}
-BOOL IniReadSettingByName(ULONG SectionId, PUCHAR SettingName, PUCHAR Buffer, ULONG BufferSize)
+BOOL IniReadSettingByName(ULONG SectionId, PCHAR SettingName, PCHAR Buffer, ULONG BufferSize)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
PINI_SECTION_ITEM SectionItem;
return FALSE;
}
-BOOL IniAddSection(PUCHAR SectionName, ULONG* SectionId)
+BOOL IniAddSection(PCHAR SectionName, ULONG* SectionId)
{
PINI_SECTION Section;
return TRUE;
}
-BOOL IniAddSettingValueToSection(ULONG SectionId, PUCHAR SettingName, PUCHAR SettingValue)
+BOOL IniAddSettingValueToSection(ULONG SectionId, PCHAR SettingName, PCHAR SettingValue)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
PINI_SECTION_ITEM SectionItem;
ULONG IniFileSettingCount = 0;
-BOOL IniParseFile(PUCHAR IniFileData, ULONG IniFileSize)
+BOOL IniParseFile(PCHAR IniFileData, ULONG IniFileSize)
{
ULONG CurrentOffset;
ULONG CurrentLineNumber;
- PUCHAR IniFileLine;
+ PCHAR IniFileLine;
ULONG IniFileLineSize;
ULONG LineLength;
PINI_SECTION CurrentSection = NULL;
return TRUE;
}
-ULONG IniGetNextLineSize(PUCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset)
+ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset)
{
ULONG Idx;
ULONG LineCharCount = 0;
return LineCharCount;
}
-ULONG IniGetNextLine(PUCHAR IniFileData, ULONG IniFileSize, PUCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset)
+ULONG IniGetNextLine(PCHAR IniFileData, ULONG IniFileSize, PCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset)
{
ULONG Idx;
return CurrentOffset;
}
-BOOL IniIsLineEmpty(PUCHAR LineOfText, ULONG TextLength)
+BOOL IniIsLineEmpty(PCHAR LineOfText, ULONG TextLength)
{
ULONG Idx;
return TRUE;
}
-BOOL IniIsCommentLine(PUCHAR LineOfText, ULONG TextLength)
+BOOL IniIsCommentLine(PCHAR LineOfText, ULONG TextLength)
{
ULONG Idx;
return FALSE;
}
-BOOL IniIsSectionName(PUCHAR LineOfText, ULONG TextLength)
+BOOL IniIsSectionName(PCHAR LineOfText, ULONG TextLength)
{
ULONG Idx;
return FALSE;
}
-ULONG IniGetSectionNameSize(PUCHAR SectionNameLine, ULONG LineLength)
+ULONG IniGetSectionNameSize(PCHAR SectionNameLine, ULONG LineLength)
{
ULONG Idx;
ULONG NameSize;
return NameSize;
}
-VOID IniExtractSectionName(PUCHAR SectionName, PUCHAR SectionNameLine, ULONG LineLength)
+VOID IniExtractSectionName(PCHAR SectionName, PCHAR SectionNameLine, ULONG LineLength)
{
ULONG Idx;
ULONG DestIdx;
SectionName[DestIdx] = '\0';
}
-BOOL IniIsSetting(PUCHAR LineOfText, ULONG TextLength)
+BOOL IniIsSetting(PCHAR LineOfText, ULONG TextLength)
{
ULONG Idx;
return FALSE;
}
-ULONG IniGetSettingNameSize(PUCHAR SettingNameLine, ULONG LineLength)
+ULONG IniGetSettingNameSize(PCHAR SettingNameLine, ULONG LineLength)
{
ULONG Idx;
ULONG NameSize;
return NameSize;
}
-ULONG IniGetSettingValueSize(PUCHAR SettingValueLine, ULONG LineLength)
+ULONG IniGetSettingValueSize(PCHAR SettingValueLine, ULONG LineLength)
{
ULONG Idx;
ULONG ValueSize;
return ValueSize;
}
-VOID IniExtractSettingName(PUCHAR SettingName, PUCHAR SettingNameLine, ULONG LineLength)
+VOID IniExtractSettingName(PCHAR SettingName, PCHAR SettingNameLine, ULONG LineLength)
{
ULONG Idx;
ULONG DestIdx;
SettingName[DestIdx] = '\0';
}
-VOID IniExtractSettingValue(PUCHAR SettingValue, PUCHAR SettingValueLine, ULONG LineLength)
+VOID IniExtractSettingValue(PCHAR SettingValue, PCHAR SettingValueLine, ULONG LineLength)
{
ULONG Idx;
ULONG DestIdx;
BOOL NewStyleLinuxKernel = FALSE;
ULONG LinuxKernelSize = 0;
ULONG LinuxInitrdSize = 0;
-UCHAR LinuxKernelName[260];
-UCHAR LinuxInitrdName[260];
+CHAR LinuxKernelName[260];
+CHAR LinuxInitrdName[260];
BOOL LinuxHasInitrd = FALSE;
-UCHAR LinuxCommandLine[260] = "";
+CHAR LinuxCommandLine[260] = "";
ULONG LinuxCommandLineSize = 0;
PVOID LinuxKernelLoadAddress = NULL;
PVOID LinuxInitrdLoadAddress = NULL;
-UCHAR LinuxBootDescription[80];
-UCHAR LinuxBootPath[260] = "";
+CHAR LinuxBootDescription[80];
+CHAR LinuxBootPath[260] = "";
-VOID LoadAndBootLinux(PUCHAR OperatingSystemName, PUCHAR Description)
+VOID LoadAndBootLinux(PCHAR OperatingSystemName, PCHAR Description)
{
PFILE LinuxKernel = NULL;
PFILE LinuxInitrdFile = NULL;
- UCHAR TempString[260];
+ CHAR TempString[260];
UiDrawBackdrop();
LinuxCommandLineSize = 0;
}
-BOOL LinuxParseIniSection(PUCHAR OperatingSystemName)
+BOOL LinuxParseIniSection(PCHAR OperatingSystemName)
{
- UCHAR SettingName[260];
+ CHAR SettingName[260];
ULONG SectionId;
// Find all the message box settings and run them
BOOL LinuxReadKernel(PFILE LinuxKernelFile)
{
ULONG BytesLoaded;
- UCHAR StatusText[260];
+ CHAR StatusText[260];
PVOID LoadAddress;
sprintf(StatusText, "Loading %s", LinuxKernelName);
BOOL LinuxReadInitrd(PFILE LinuxInitrdFile)
{
ULONG BytesLoaded;
- UCHAR StatusText[260];
+ CHAR StatusText[260];
sprintf(StatusText, "Loading %s", LinuxInitrdName);
UiDrawStatusText(StatusText);
#include <drivemap.h>
#include <machine.h>
-VOID LoadAndBootBootSector(PUCHAR OperatingSystemName)
+VOID LoadAndBootBootSector(PCHAR OperatingSystemName)
{
PFILE FilePointer;
- UCHAR SettingName[80];
+ CHAR SettingName[80];
ULONG SectionId;
- UCHAR FileName[260];
+ CHAR FileName[260];
ULONG BytesRead;
// Find all the message box settings and run them
ChainLoadBiosBootSectorCode();
}
-VOID LoadAndBootPartition(PUCHAR OperatingSystemName)
+VOID LoadAndBootPartition(PCHAR OperatingSystemName)
{
- UCHAR SettingName[80];
- UCHAR SettingValue[80];
+ CHAR SettingName[80];
+ CHAR SettingValue[80];
ULONG SectionId;
PARTITION_TABLE_ENTRY PartitionTableEntry;
ULONG DriveNumber;
ChainLoadBiosBootSectorCode();
}
-VOID LoadAndBootDrive(PUCHAR OperatingSystemName)
+VOID LoadAndBootDrive(PCHAR OperatingSystemName)
{
- UCHAR SettingName[80];
- UCHAR SettingValue[80];
+ CHAR SettingName[80];
+ CHAR SettingValue[80];
ULONG SectionId;
ULONG DriveNumber;
#include <arch.h>
-PUCHAR OptionsMenuList[] =
+PCHAR OptionsMenuList[] =
{
"Safe Mode",
"Safe Mode with Networking",
#include <mm.h>
#include <ui.h>
-BOOL InitOperatingSystemList(PUCHAR **SectionNamesPointer, PUCHAR **DisplayNamesPointer, ULONG* OperatingSystemCountPointer)
+BOOL InitOperatingSystemList(PCHAR **SectionNamesPointer, PCHAR **DisplayNamesPointer, ULONG* OperatingSystemCountPointer)
{
ULONG Idx;
ULONG CurrentOperatingSystemIndex;
- UCHAR SettingName[260];
- UCHAR SettingValue[260];
+ CHAR SettingName[260];
+ CHAR SettingValue[260];
ULONG OperatingSystemCount;
ULONG SectionId;
ULONG OperatingSystemSectionId;
ULONG SectionSettingCount;
- PUCHAR *OperatingSystemSectionNames;
- PUCHAR *OperatingSystemDisplayNames;
+ PCHAR *OperatingSystemSectionNames;
+ PCHAR *OperatingSystemDisplayNames;
//
// Open the [FreeLoader] section
ULONG CountOperatingSystems(ULONG SectionId)
{
ULONG Idx;
- UCHAR SettingName[260];
- UCHAR SettingValue[260];
+ CHAR SettingName[260];
+ CHAR SettingValue[260];
ULONG OperatingSystemCount = 0;
ULONG SectionSettingCount;
return OperatingSystemCount;
}
-BOOL AllocateListMemory(PUCHAR **SectionNamesPointer, PUCHAR **DisplayNamesPointer, ULONG OperatingSystemCount)
+BOOL AllocateListMemory(PCHAR **SectionNamesPointer, PCHAR **DisplayNamesPointer, ULONG OperatingSystemCount)
{
ULONG Idx;
- PUCHAR *OperatingSystemSectionNames = NULL;
- PUCHAR *OperatingSystemDisplayNames = NULL;
+ PCHAR *OperatingSystemSectionNames = NULL;
+ PCHAR *OperatingSystemDisplayNames = NULL;
//
// Allocate memory to hold operating system list arrays
//
- OperatingSystemSectionNames = (PUCHAR*) MmAllocateMemory( sizeof(PUCHAR) * OperatingSystemCount);
- OperatingSystemDisplayNames = (PUCHAR*) MmAllocateMemory( sizeof(PUCHAR) * OperatingSystemCount);
+ OperatingSystemSectionNames = MmAllocateMemory( sizeof(PCHAR) * OperatingSystemCount);
+ OperatingSystemDisplayNames = MmAllocateMemory( sizeof(PCHAR) * OperatingSystemCount);
//
// If either allocation failed then return FALSE
//
// Clear our newly allocated memory
//
- memset(OperatingSystemSectionNames, 0, sizeof(PUCHAR) * OperatingSystemCount);
- memset(OperatingSystemDisplayNames, 0, sizeof(PUCHAR) * OperatingSystemCount);
+ memset(OperatingSystemSectionNames, 0, sizeof(PCHAR) * OperatingSystemCount);
+ memset(OperatingSystemDisplayNames, 0, sizeof(PCHAR) * OperatingSystemCount);
//
// Loop through each array element and allocate it's string memory
//
for (Idx=0; Idx<OperatingSystemCount; Idx++)
{
- OperatingSystemSectionNames[Idx] = (PUCHAR) MmAllocateMemory(80);
- OperatingSystemDisplayNames[Idx] = (PUCHAR) MmAllocateMemory(80);
+ OperatingSystemSectionNames[Idx] = MmAllocateMemory(80);
+ OperatingSystemDisplayNames[Idx] = MmAllocateMemory(80);
//
// If it failed then jump to the cleanup code
return FALSE;
}
-BOOL RemoveQuotes(PUCHAR QuotedString)
+BOOL RemoveQuotes(PCHAR QuotedString)
{
- UCHAR TempString[200];
+ CHAR TempString[200];
//
// If this string is not quoted then return FALSE
#include <rtl.h>
-BOOL DissectArcPath(char *ArcPath, char *BootPath, ULONG* BootDrive, ULONG* BootPartition)
+BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* BootPartition)
{
char *p;
return TRUE;
}
-void ConstructArcPath(PUCHAR ArcPath, PUCHAR SystemFolder, ULONG Disk, ULONG Partition)
+VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, ULONG Disk, ULONG Partition)
{
char tmp[50];
}
}
-ULONG ConvertArcNameToBiosDriveNumber(PUCHAR ArcPath)
+ULONG ConvertArcNameToBiosDriveNumber(PCHAR ArcPath)
{
char * p;
ULONG DriveNumber = 0;
USHORT ClassSize;
/* Name of key (not zero terminated) */
- UCHAR Name[0];
+ CHAR Name[0];
} __attribute__((packed)) KEY_CELL, *PKEY_CELL;
ULONG DataType;
USHORT Flags;
USHORT Unused1;
- UCHAR Name[0]; /* warning : not zero terminated */
+ CHAR Name[0]; /* warning : not zero terminated */
} __attribute__((packed)) VALUE_CELL, *PVALUE_CELL;
/* VALUE_CELL.Flags constants */
typedef struct _DATA_CELL
{
LONG CellSize;
- UCHAR Data[0];
+ CHAR Data[0];
} __attribute__((packed)) DATA_CELL, *PDATA_CELL;
ULONG SrcDataSize;
ULONG DstDataSize;
ULONG DataType;
- PUCHAR Data;
+ PCHAR Data;
BOOL Expand = FALSE;
DbgPrint((DPRINT_REGISTRY, "CmiExportValue('%s') called\n",
Error = RegSetValue(Key,
cName,
ValueCell->DataType,
- (PUCHAR)&ValueCell->DataOffset,
+ (PCHAR)&ValueCell->DataOffset,
DataSize);
if (Error != ERROR_SUCCESS)
{
Error = RegSetValue (Key,
cName,
ValueCell->DataType,
- (PUCHAR)DataCell->Data,
+ DataCell->Data,
DataSize);
}
if (Error != ERROR_SUCCESS)
ULONG ValueType;
ULONG StartValue;
ULONG TagValue;
- UCHAR DriverGroup[256];
+ CHAR DriverGroup[256];
ULONG DriverGroupSize;
- UCHAR ImagePath[256];
- UCHAR TempImagePath[256];
+ CHAR ImagePath[256];
+ CHAR TempImagePath[256];
/* get 'service group order' key */
rc = RegOpenKey(NULL,
}
VOID
-LoadAndBootReactOS(PUCHAR OperatingSystemName)
+LoadAndBootReactOS(PCHAR OperatingSystemName)
{
PFILE FilePointer;
CHAR name[1024];
RootKey->ValueCount = 0;
RootKey->NameSize = 2;
- RootKey->Name = (PUCHAR)MmAllocateMemory (2);
+ RootKey->Name = MmAllocateMemory (2);
strcpy (RootKey->Name, "\\");
RootKey->DataType = 0;
Error = RegSetValue(LinkKey,
NULL,
REG_LINK,
- (PUCHAR)&ControlSetKey,
+ (PCHAR)&ControlSetKey,
sizeof(PVOID));
if (Error != ERROR_SUCCESS)
{
RegSetValue(FRLDRHKEY Key,
PCHAR ValueName,
ULONG Type,
- PUCHAR Data,
+ PCHAR Data,
ULONG DataSize)
{
PLIST_ENTRY Ptr;
}
else
{
- Key->Data = (PUCHAR)MmAllocateMemory(DataSize);
+ Key->Data = MmAllocateMemory(DataSize);
Key->DataSize = DataSize;
Key->DataType = Type;
memcpy(Key->Data, Data, DataSize);
}
else
{
- Value->Data = (PUCHAR)MmAllocateMemory(DataSize);
+ Value->Data = MmAllocateMemory(DataSize);
if (Value->Data == NULL)
return(ERROR_OUTOFMEMORY);
Value->DataType = Type;
ULONG ValueCount;
ULONG NameSize;
- PUCHAR Name;
+ PCHAR Name;
/* default data */
ULONG DataType;
ULONG DataSize;
- PUCHAR Data;
+ PCHAR Data;
} KEY, *FRLDRHKEY, **PFRLDRHKEY;
/* value name */
ULONG NameSize;
- PUCHAR Name;
+ PCHAR Name;
/* value data */
ULONG DataType;
ULONG DataSize;
- PUCHAR Data;
+ PCHAR Data;
} VALUE, *PVALUE;
RegSetValue(FRLDRHKEY Key,
PCHAR ValueName,
ULONG Type,
- PUCHAR Data,
+ PCHAR Data,
ULONG DataSize);
LONG
* FillArea()
* This function assumes coordinates are zero-based
*/
-VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */)
+VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
ULONG i, j;
// Loop through each character (column) in the line and fill it in
for (j=Left; j<=Right; j++)
{
- ScreenMemory[((i*2)*UiScreenWidth)+(j*2)] = FillChar;
+ ScreenMemory[((i*2)*UiScreenWidth)+(j*2)] = (UCHAR)FillChar;
ScreenMemory[((i*2)*UiScreenWidth)+(j*2)+1] = Attr;
}
}
* DrawText()
* This function assumes coordinates are zero-based
*/
-VOID TuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr)
+VOID TuiDrawText(ULONG X, ULONG Y, PCHAR Text, UCHAR Attr)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
ULONG i, j;
// Draw the text
for (i=X, j=0; Text[j] && i<UiScreenWidth; i++,j++)
{
- ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = Text[j];
+ ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = (UCHAR)Text[j];
ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr;
}
}
-VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PUCHAR TextString, UCHAR Attr)
+VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCHAR TextString, UCHAR Attr)
{
ULONG TextLength;
ULONG BoxWidth;
ULONG RealTop;
ULONG X;
ULONG Y;
- UCHAR Temp[2];
+ CHAR Temp[2];
TextLength = strlen(TextString);
}
}
-VOID TuiDrawStatusText(PUCHAR StatusText)
+VOID TuiDrawStatusText(PCHAR StatusText)
{
ULONG i;
{
ULONG Year, Month, Day;
ULONG Hour, Minute, Second;
- UCHAR DateString[40];
- UCHAR TimeString[40];
- UCHAR TempString[20];
+ CHAR DateString[40];
+ CHAR TimeString[40];
+ CHAR TempString[20];
BOOL PMHour = FALSE;
MachRTCGetCurrentDateTime(&Year, &Month, &Day, &Hour, &Minute, &Second);
}
}
-VOID TuiMessageBox(PUCHAR MessageText)
+VOID TuiMessageBox(PCHAR MessageText)
{
PVOID ScreenBuffer;
MmFreeMemory(ScreenBuffer);
}
-VOID TuiMessageBoxCritical(PUCHAR MessageText)
+VOID TuiMessageBoxCritical(PCHAR MessageText)
{
int width = 8;
int height = 1;
}
-VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PUCHAR ProgressText)
+VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
{
ULONG Left, Top, Right, Bottom;
ULONG Width = 50; // Allow for 50 "bars"
TuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText);
}
-VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PUCHAR ProgressText)
+VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
{
ULONG i;
ULONG ProgressBarWidth = (Right - Left) - 3;
VideoCopyOffScreenBufferToVRAM();
}
-UCHAR TuiTextToColor(PUCHAR ColorText)
+UCHAR TuiTextToColor(PCHAR ColorText)
{
if (stricmp(ColorText, "Black") == 0)
return COLOR_BLACK;
return COLOR_BLACK;
}
-UCHAR TuiTextToFillStyle(PUCHAR FillStyleText)
+UCHAR TuiTextToFillStyle(PCHAR FillStyleText)
{
if (stricmp(FillStyleText, "Light") == 0)
{
}
-BOOL TuiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, ULONG Length)
+BOOL TuiEditBox(PCHAR MessageText, PCHAR EditTextBuffer, ULONG Length)
{
int width = 8;
int height = 1;
VOID TuiUnInitialize(VOID); // Un-initialize User-Interface
VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
-VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
+VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
VOID TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified
-VOID TuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr); // Draws text at coordinates specified
-VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PUCHAR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
-VOID TuiDrawStatusText(PUCHAR StatusText); // Draws text at the very bottom line on the screen
+VOID TuiDrawText(ULONG X, ULONG Y, PCHAR Text, UCHAR Attr); // Draws text at coordinates specified
+VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCHAR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
+VOID TuiDrawStatusText(PCHAR StatusText); // Draws text at the very bottom line on the screen
VOID TuiUpdateDateTime(VOID); // Updates the date and time
VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
-VOID TuiMessageBox(PUCHAR MessageText); // Displays a message box on the screen with an ok button
-VOID TuiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
-VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
-VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
-BOOL TuiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, ULONG Length);
+VOID TuiMessageBox(PCHAR MessageText); // Displays a message box on the screen with an ok button
+VOID TuiMessageBoxCritical(PCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
+VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
+VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
+BOOL TuiEditBox(PCHAR MessageText, PCHAR EditTextBuffer, ULONG Length);
-UCHAR TuiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value
-UCHAR TuiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
+UCHAR TuiTextToColor(PCHAR ColorText); // Converts the text color into it's equivalent color value
+UCHAR TuiTextToFillStyle(PCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
VOID TuiFadeOut(VOID); // Fades the screen out
typedef struct
{
- PUCHAR *MenuItemList;
+ PCHAR *MenuItemList;
ULONG MenuItemCount;
LONG MenuTimeRemaining;
ULONG SelectedMenuItem;
VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo);
VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, ULONG MenuItemNumber);
ULONG TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter);
-BOOL TuiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
+BOOL TuiDisplayMenu(PCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
/*
#include <video.h>
-BOOL TuiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
+BOOL TuiDisplayMenu(PCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
{
TUI_MENU_INFO MenuInformation;
ULONG LastClockSecond;
VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo)
{
- UCHAR MenuLineText[80];
- UCHAR TempString[80];
+ CHAR MenuLineText[80];
+ CHAR TempString[80];
ULONG Idx;
//
VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, ULONG MenuItemNumber)
{
ULONG Idx;
- UCHAR MenuLineText[80];
+ CHAR MenuLineText[80];
ULONG SpaceTotal;
ULONG SpaceLeft;
ULONG SpaceRight;
UCHAR UiEditBoxTextColor = COLOR_WHITE; // Edit box text color
UCHAR UiEditBoxBgColor = COLOR_BLACK; // Edit box text background color
-UCHAR UiTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
+CHAR UiTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
BOOL UserInterfaceUp = FALSE; // Tells us if the user interface is displayed
BOOL UiUseSpecialEffects = FALSE; // Tells us if we should use fade effects
-UCHAR UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
+CHAR UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
BOOL UiInitialize(BOOLEAN ShowGui)
{
ULONG SectionId;
- UCHAR DisplayModeText[260];
- UCHAR SettingText[260];
+ CHAR DisplayModeText[260];
+ CHAR SettingText[260];
ULONG Depth;
if (!ShowGui) {
return TRUE;
}
-VOID UiUnInitialize(PUCHAR BootText)
+VOID UiUnInitialize(PCHAR BootText)
{
UiDrawBackdrop();
UiDrawStatusText("Booting...");
}
}
-VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */)
+VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr)
+VOID UiDrawText(ULONG X, ULONG Y, PCHAR Text, UCHAR Attr)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PUCHAR TextString, UCHAR Attr)
+VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCHAR TextString, UCHAR Attr)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiDrawStatusText(PUCHAR StatusText)
+VOID UiDrawStatusText(PCHAR StatusText)
{
if (!UserInterfaceUp) return;
}
}
-VOID UiInfoBox(PUCHAR MessageText)
+VOID UiInfoBox(PCHAR MessageText)
{
ULONG TextLength;
ULONG BoxWidth;
UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
}
-VOID UiMessageBox(PUCHAR MessageText)
+VOID UiMessageBox(PCHAR MessageText)
{
// We have not yet displayed the user interface
// We are probably still reading the .ini file
}
}
-VOID UiMessageBoxCritical(PUCHAR MessageText)
+VOID UiMessageBoxCritical(PCHAR MessageText)
{
// We have not yet displayed the user interface
// We are probably still reading the .ini file
}
}
-UCHAR UiTextToColor(PUCHAR ColorText)
+UCHAR UiTextToColor(PCHAR ColorText)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-UCHAR UiTextToFillStyle(PUCHAR FillStyleText)
+UCHAR UiTextToFillStyle(PCHAR FillStyleText)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PUCHAR ProgressText)
+VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
{
if (!UserInterfaceUp) return;
}
}
-VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PUCHAR ProgressText)
+VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiShowMessageBoxesInSection(PUCHAR SectionName)
+VOID UiShowMessageBoxesInSection(PCHAR SectionName)
{
ULONG Idx;
- UCHAR SettingName[80];
- UCHAR SettingValue[80];
- PUCHAR MessageBoxText;
+ CHAR SettingName[80];
+ CHAR SettingValue[80];
+ PCHAR MessageBoxText;
ULONG MessageBoxTextSize;
ULONG SectionId;
//if (MessageBoxTextSize > 0)
{
// Allocate enough memory to hold the text
- MessageBoxText = (PUCHAR)MmAllocateMemory(MessageBoxTextSize);
+ MessageBoxText = MmAllocateMemory(MessageBoxTextSize);
if (MessageBoxText)
{
}
}
-VOID UiEscapeString(PUCHAR String)
+VOID UiEscapeString(PCHAR String)
{
ULONG Idx;
}
}
-VOID UiTruncateStringEllipsis(PUCHAR StringText, ULONG MaxChars)
+VOID UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars)
{
if (strlen(StringText) > MaxChars)
{
}
}
-BOOL UiDisplayMenu(PUCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
+BOOL UiDisplayMenu(PCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-BOOL UiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, ULONG Length)
+BOOL UiEditBox(PCHAR MessageText, PCHAR EditTextBuffer, ULONG Length)
{
if (VideoTextMode == UiDisplayMode)
{
#include <version.h>
#include <rtl.h>
-UCHAR FreeLoaderVersionString[80];
+CHAR FreeLoaderVersionString[80];
-PUCHAR GetFreeLoaderVersionString(VOID)
+PCHAR GetFreeLoaderVersionString(VOID)
{
if (FREELOADER_PATCH_VERSION == 0)
{
}
case TargetDeviceRelation:
{
- PDEVICE_RELATIONS DeviceRelations;
+ PDEVICE_RELATIONS DeviceRelations = NULL;
DPRINT("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
Status = SerenumPdoQueryDeviceRelations(DeviceObject, &DeviceRelations);
Information = (ULONG_PTR)DeviceRelations;
{
UCHAR Type; /* 1 */
UCHAR BusId; /* Bus ID */
- UCHAR BusType[6]; /* Bus type */
+ CHAR BusType[6]; /* Bus type */
} __attribute__((packed)) MP_CONFIGURATION_BUS, *PMP_CONFIGURATION_BUS;
#define MAX_BUS 32
{
USHORT Length;
USHORT Flags;
- UCHAR Text[1];
+ CHAR Text[1];
} RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY;
typedef struct _RTL_MESSAGE_RESOURCE_BLOCK
for (;;) {
udpaddrlen= sizeof(udpaddr);
ADNS_CLEAR_ERRNO;
- r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,
+ r= recvfrom(ads->udpsocket,(char*)udpbuf,sizeof(udpbuf),0,
(struct sockaddr*)&udpaddr,&udpaddrlen);
ADNS_CAPTURE_ERRNO;
if (r<0) {
int adns__vbuf_appendstr(vbuf *vb, const char *data) {
int l;
l= strlen(data);
- return adns__vbuf_append(vb,data,l);
+ return adns__vbuf_append(vb,(byte*)data,l);
}
void adns__vbuf_free(vbuf *vb) {
if (!(adns__vbuf_appendstr(vb,"<bad format... ") &&
adns__vbuf_appendstr(vb,adns_strerror(st)) &&
adns__vbuf_appendstr(vb,">") &&
- adns__vbuf_append(vb,"",1))) {
+ adns__vbuf_append(vb,(byte*)"",1))) {
return "<cannot report bad format... out of memory>";
}
}
if (!vb->used) {
adns__vbuf_appendstr(vb,"<truncated ...>");
- adns__vbuf_append(vb,"",1);
+ adns__vbuf_append(vb,(byte*)"",1);
}
- return vb->buf;
+ return (char*)vb->buf;
}
adns_status adns_rr_info(adns_rrtype type,
adns__vbuf_init(&vb);
st= typei->convstring(&vb,datap);
if (st) goto x_freevb;
- if (!adns__vbuf_append(&vb,"",1)) { st= adns_s_nomemory; goto x_freevb; }
- assert((int)strlen(vb.buf) == vb.used-1);
+ if (!adns__vbuf_append(&vb,(byte*)"",1)) { st= adns_s_nomemory; goto x_freevb; }
+ assert((int)strlen((char*)vb.buf) == vb.used-1);
*data_r= realloc(vb.buf, (size_t) vb.used);
- if (!*data_r) *data_r= vb.buf;
+ if (!*data_r) *data_r= (char*)vb.buf;
return adns_s_ok;
x_freevb:
break;
}
}
- if (!adns__vbuf_append(vb,buf,i) || !adns__vbuf_append(vb,qbuf,(int) strlen(qbuf)))
+ if (!adns__vbuf_append(vb,buf,i) || !adns__vbuf_append(vb,(byte*)qbuf,(int) strlen(qbuf)))
return 0;
if (i<len) i++;
buf+= i;
int lablen, jumpto;
const char *dgram;
- dgram= fls->dgram;
+ dgram= (char*)fls->dgram;
for (;;) {
if (fls->cbyte >= fls->dglen) goto x_truncated;
if (fls->cbyte >= fls->max) goto x_badresponse;
if (first) {
first= 0;
} else {
- if (!adns__vbuf_append(vb,".",1)) return adns_s_nomemory;
+ if (!adns__vbuf_append(vb,(byte*)".",1)) return adns_s_nomemory;
}
if (flags & pdf_quoteok) {
if (!vbuf__append_quoted1035(vb,dgram+labstart,lablen))
return adns_s_nomemory;
}
}
- if (!adns__vbuf_append(vb,"",1)) return adns_s_nomemory;
+ if (!adns__vbuf_append(vb,(byte*)"",1)) return adns_s_nomemory;
return adns_s_ok;
}
qu->search_vb.used= qu->search_origlen;
if (nextentry) {
- if (!adns__vbuf_append(&qu->search_vb,".",1) ||
+ if (!adns__vbuf_append(&qu->search_vb,(byte*)".",1) ||
!adns__vbuf_appendstr(&qu->search_vb,nextentry)) {
stat= adns_s_nomemory; goto x_fail;
}
free(qu->query_dgram);
qu->query_dgram= 0; qu->query_dglen= 0;
- query_simple(ads,qu, qu->search_vb.buf, qu->search_vb.used, qu->typei, qu->flags, now);
+ query_simple(ads,qu, (char*)qu->search_vb.buf, qu->search_vb.used, qu->typei, qu->flags, now);
return;
x_fail:
}
if (flags & adns_qf_search) {
- r= adns__vbuf_append(&qu->search_vb,owner,ol);
+ r= adns__vbuf_append(&qu->search_vb,(byte*)owner,ol);
if (!r) { stat= adns_s_nomemory; goto x_adnsfail; }
for (ndots=0, p=owner; (p= strchr(p,'.')); p++, ndots++);
if (qu->flags & adns_qf_owner && qu->flags & adns_qf_search &&
ans->status != adns_s_nomemory) {
- if (!save_owner(qu, qu->search_vb.buf, qu->search_vb.used)) {
+ if (!save_owner(qu, (char*)qu->search_vb.buf, qu->search_vb.used)) {
adns__query_fail(qu,adns_s_nomemory);
return;
}
dgram,dglen, &rdstart,rdstart+rdlength);
if (!qu->vb.used) goto x_truncated;
if (st) { adns__query_fail(qu,st); return; }
- l= strlen(qu->vb.buf)+1;
+ l= strlen((char*)qu->vb.buf)+1;
qu->answer->cname= adns__alloc_preserved(qu,(size_t) l);
if (!qu->answer->cname) { adns__query_fail(qu,adns_s_nomemory); return; }
if (ads->tcpsend.used) {
wr= 0;
} else {
- iov[0].iov_base= length;
+ iov[0].iov_base= (char*)length;
iov[0].iov_len= 2;
- iov[1].iov_base= qu->query_dgram;
+ iov[1].iov_base= (char*)qu->query_dgram;
iov[1].iov_len= qu->query_dglen;
adns__sigpipe_protect(qu->ads);
wr= writev(qu->ads->tcpsocket,iov,2);
servaddr.sin_port= htons(DNS_PORT);
ADNS_CLEAR_ERRNO;
- r= sendto(ads->udpsocket,qu->query_dgram,qu->query_dglen,0,
+ r= sendto(ads->udpsocket,(char*)qu->query_dgram,qu->query_dglen,0,
(const struct sockaddr*)&servaddr,sizeof(servaddr));
ADNS_CAPTURE_ERRNO;
if (r<0 && errno == EMSGSIZE) { qu->retries= 0; query_usetcp(qu,now); return; }
if (needquote || neednorm) {
r= adns__vbuf_ensure(vb, lablen+needquote+4); if (!r) R_NOMEM;
- adns__vbuf_appendq(vb,"\"",1);
+ adns__vbuf_appendq(vb,(byte*)"\"",1);
for (i=0, needquote=0, p= pai->dgram+labstart; i<lablen; i++, p++) {
c= *p;
- if (c == '"' || c=='\\') adns__vbuf_appendq(vb,"\\",1);
+ if (c == '"' || c=='\\') adns__vbuf_appendq(vb,(byte*)"\\",1);
adns__vbuf_appendq(vb,p,1);
}
- adns__vbuf_appendq(vb,"\"",1);
+ adns__vbuf_appendq(vb,(byte*)"\"",1);
} else {
r= adns__vbuf_append(vb, pai->dgram+labstart, lablen); if (!r) R_NOMEM;
}
return cdtDrawExt(hdc, x, y, CARD_WIDTH, CARD_HEIGHT, card, type, color);
}
+/*
+ * internal
+ */
+inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, DWORD dwRasterOp, BOOL bStretch)
+{
+ if (bStretch)
+ {
+ StretchBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, CARD_WIDTH, CARD_HEIGHT, dwRasterOp);
+ } else
+ {
+ BitBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, dwRasterOp);
+/*
+ * This is need when using Microsoft images, because they use two-color red/white images for
+ * red cards and thus needs fix-up of the edge to black color.
+ */
+#if 0
+ if (ISREDCARD(card))
+ {
+ PatBlt(hdc, x, y + 2, 1, dy - 4, BLACKNESS);
+ PatBlt(hdc, x + dx - 1, y + 2, 1, dy - 4, BLACKNESS);
+ PatBlt(hdc, x + 2, y, dx - 4, 1, BLACKNESS);
+ PatBlt(hdc, x + 2, y + dy - 1, dx - 4, 1, BLACKNESS);
+ SetPixel(hdc, x + 1, y + 1, 0);
+ SetPixel(hdc, x + dx - 2, y + 1, 0);
+ SetPixel(hdc, x + 1, y + dy - 2, 0);
+ SetPixel(hdc, x + dx - 2, y + dy - 2, 0);
+ }
+#endif
+ }
+}
+
/*
* Render card
*
BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type, COLORREF color)
{
HDC hdcCard;
- COLORREF SavedPixels[12];
DWORD dwRasterOp = SRCCOPY, OldBkColor;
BOOL bSaveEdges = TRUE;
BOOL bStretch = FALSE;
OldBkColor = SetBkColor(hdc, (type == ectFACES) ? 0xFFFFFF : color);
if (bSaveEdges)
{
+ COLORREF SavedPixels[12];
SavedPixels[0] = GetPixel(hdc, x, y);
SavedPixels[1] = GetPixel(hdc, x + 1, y);
SavedPixels[2] = GetPixel(hdc, x, y + 1);
SavedPixels[8] = GetPixel(hdc, x, y + dy - 2);
SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1);
SavedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1);
- SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2);
- }
- if (bStretch)
- {
- StretchBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, CARD_WIDTH, CARD_HEIGHT, dwRasterOp);
- } else
- {
- BitBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, dwRasterOp);
-/*
- * This is need when using Microsoft images, because they use two-color red/white images for
- * red cards and thus needs fix-up of the edge to black color.
- */
-#if 0
- if (ISREDCARD(card))
- {
- PatBlt(hdc, x, y + 2, 1, dy - 4, BLACKNESS);
- PatBlt(hdc, x + dx - 1, y + 2, 1, dy - 4, BLACKNESS);
- PatBlt(hdc, x + 2, y, dx - 4, 1, BLACKNESS);
- PatBlt(hdc, x + 2, y + dy - 1, dx - 4, 1, BLACKNESS);
- SetPixel(hdc, x + 1, y + 1, 0);
- SetPixel(hdc, x + dx - 2, y + 1, 0);
- SetPixel(hdc, x + 1, y + dy - 2, 0);
- SetPixel(hdc, x + dx - 2, y + dy - 2, 0);
- }
-#endif
- }
- if (bSaveEdges)
- {
- SetPixel(hdc, x, y, SavedPixels[0]);
+ SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2);
+
+ BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch);
+
+ SetPixel(hdc, x, y, SavedPixels[0]);
SetPixel(hdc, x + 1, y, SavedPixels[1]);
SetPixel(hdc, x, y + 1, SavedPixels[2]);
SetPixel(hdc, x + dx - 1, y, SavedPixels[3]);
SetPixel(hdc, x + dx - 1, y + dy - 1, SavedPixels[9]);
SetPixel(hdc, x + dx - 2, y + dy - 1, SavedPixels[10]);
SetPixel(hdc, x + dx - 1, y + dy - 2, SavedPixels[11]);
- }
+ }
+ else
+ {
+ BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch);
+ }
SetBkColor(hdc, OldBkColor);
DeleteDC(hdcCard);
}
PDEBUG_BUFFER HeapDebug, ModuleDebug;
PVOID ProcThrdInfo;
ULONG ProcThrdInfoSize;
- HANDLE hSnapShotSection;
NTSTATUS Status;
+ HANDLE hSnapShotSection = NULL;
if(th32ProcessID == 0)
{
Style = IntMapWindowStyle(p->ulStyle, &ExStyle);
/* convert the window caption to unicode */
- MultiByteToWideChar(CP_UTF8, 0, p->cpName, -1, WindowName,
+ MultiByteToWideChar(CP_UTF8, 0, (char*)p->cpName, -1, WindowName,
sizeof(WindowName) / sizeof(WindowName[0]));
skw->Window.win_func = p->win_func;
DBG("GI_create_menu_item(0x%x, 0x%x, 0x%x, 0x%x)\n",
Text, Id, Flags, Enabled);
- TextLength = MultiByteToWideChar(CP_UTF8, 0, Text, -1, NULL, 0);
+ TextLength = MultiByteToWideChar(CP_UTF8, 0, (char*)Text, -1, NULL, 0);
MenuItem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(SKY_MENUITEM) + TextLength * sizeof(WCHAR));
if (MenuItem == NULL)
return NULL;
}
- lstrcpyA(MenuItem->MenuItem.text, Text);
+ lstrcpyA((char*)MenuItem->MenuItem.text, (char*)Text);
MenuItem->MenuItem.ID = Id;
MenuItem->MenuItem.flags = Flags;
MenuItem->MenuItem.enabled = Enabled;
MenuItem->MenuItemInfo.wID = Id;
MenuItem->MenuItemInfo.dwTypeData = (LPWSTR)(MenuItem + 1);
MenuItem->MenuItemInfo.cch = TextLength;
- MultiByteToWideChar(CP_UTF8, 0, Text, TextLength, (LPWSTR)(MenuItem + 1),
+ MultiByteToWideChar(CP_UTF8, 0, (char*)Text, TextLength, (LPWSTR)(MenuItem + 1),
TextLength);
return (widget_menu_item *)MenuItem;
}
else /* SC_SIZE */
{
+ pt.x = pt.y = 0;
while(!hittest)
{
if (GetMessageW(&msg, NULL, 0, 0) <= 0)
result->faceName = (LPCWSTR)p;
p += wcslen( result->faceName ) + 1;
}
+ else
+ {
+ result->pointSize = 0;
+ result->weight = FW_DONTCARE;
+ result->italic = FALSE;
+ result->faceName = NULL;
+ }
/* First control is on dword boundary */
return (LPCSTR)((((int)p) + 3) & ~3);
newslh.Sequence = oldslh.Sequence + 1;
newslh.Depth = oldslh.Depth - 1;
newslh.Next.Next = MmSafeReadPtr(&le->Next);
- } while(ExfInterlockedCompareExchange64(&ListHead->Alignment,
- &newslh.Alignment,
- &oldslh.Alignment) != oldslh.Alignment);
+ } while(ExfInterlockedCompareExchange64((PLONGLONG)&ListHead->Alignment,
+ (PLONGLONG)&newslh.Alignment,
+ (PLONGLONG)&oldslh.Alignment) != oldslh.Alignment);
return le;
}
newslh.Depth = oldslh.Depth + 1;
newslh.Sequence = oldslh.Sequence + 1;
ListEntry->Next = oldslh.Next.Next;
- } while(ExfInterlockedCompareExchange64(&ListHead->Alignment,
- &newslh.Alignment,
- &oldslh.Alignment) != oldslh.Alignment);
+ } while(ExfInterlockedCompareExchange64((PLONGLONG)&ListHead->Alignment,
+ (PLONGLONG)&newslh.Alignment,
+ (PLONGLONG)&oldslh.Alignment) != oldslh.Alignment);
return oldslh.Next.Next;
}
}
UNICODE_STRING FileName; /* FIXME */
+ RtlInitUnicodeString(&FileName, NULL); /* FIXME */
/* FIXME */
Spfi->NextEntryOffset = 0;
ASSERT((NTSTATUS)QueueEntry != STATUS_TIMEOUT);
/* Increment Processed Work Items */
- InterlockedIncrement(&WorkQueue->WorkItemsProcessed);
+ InterlockedIncrement((PLONG)&WorkQueue->WorkItemsProcessed);
/* Get the Work Item */
WorkItem = CONTAINING_RECORD(QueueEntry, WORK_QUEUE_ITEM, List);
LONG MmMappedPagesWriteCount;
LONG MmMappedWriteIoCount;
ULONG SpareFields0[1];
- UCHAR VendorString[13];
+ CHAR VendorString[13];
UCHAR InitialApicId;
UCHAR LogicalProcessorsPerPhysicalProcessor;
ULONG MHz;
IoFreeIrp(Irp);
return EXCEPTION_CONTINUE_SEARCH;
}
- _SEH_TRY_FILTER(FreeAndGoOn)
+ _SEH_TRY
{
/* Do the probe */
MmProbeAndLockPages(Irp->MdlAddress, KernelMode, AccessType);
}
_SEH_HANDLE
{
- return NULL;
+ /* Free the IRP and its MDL */
+ IoFreeMdl(Irp->MdlAddress);
+ IoFreeIrp(Irp);
+ /* FIXME - pass the exception to the caller? */
+ Irp = NULL;
}
_SEH_END;
+
+ if (!Irp)
+ return NULL;
}
else
{
return Irp;
}
+
/*
* @implemented
*
* RETURNS: The IRP allocated on success, or
* NULL on failure
*/
-PIRP
+PIRP
STDCALL
-IoBuildDeviceIoControlRequest(ULONG IoControlCode,
+IoBuildDeviceIoControlRequest (ULONG IoControlCode,
PDEVICE_OBJECT DeviceObject,
PVOID InputBuffer,
ULONG InputBufferLength,
"Event %x, IoStatusBlock %x\n",IoControlCode,DeviceObject,
InputBuffer,InputBufferLength,OutputBuffer,OutputBufferLength,
InternalDeviceIoControl,Event,IoStatusBlock);
-
+
/* Allocate IRP */
if (!(Irp = IoAllocateIrp(DeviceObject->StackSize,TRUE))) return Irp;
-
+
/* Get the Stack */
StackPtr = IoGetNextIrpStackLocation(Irp);
-
+
/* Set the DevCtl Type */
- StackPtr->MajorFunction = InternalDeviceIoControl ?
+ StackPtr->MajorFunction = InternalDeviceIoControl ?
IRP_MJ_INTERNAL_DEVICE_CONTROL : IRP_MJ_DEVICE_CONTROL;
-
+
/* Set the IOCTL Data */
StackPtr->Parameters.DeviceIoControl.IoControlCode = IoControlCode;
StackPtr->Parameters.DeviceIoControl.InputBufferLength = InputBufferLength;
{
case METHOD_BUFFERED:
DPRINT("Using METHOD_BUFFERED!\n");
-
+
/* Select the right Buffer Length */
BufferLength = InputBufferLength > OutputBufferLength ? InputBufferLength : OutputBufferLength;
-
+
/* Make sure there is one */
if (BufferLength)
{
/* Allocate the System Buffer */
- Irp->AssociatedIrp.SystemBuffer = ExAllocatePoolWithTag(NonPagedPool,
- BufferLength,
+ Irp->AssociatedIrp.SystemBuffer = ExAllocatePoolWithTag(NonPagedPool,
+ BufferLength,
TAG_SYS_BUF);
/* Fail if we couldn't */
IoFreeIrp(Irp);
return(NULL);
}
-
+
/* Check if we got a buffer */
if (InputBuffer)
{
/* Copy into the System Buffer */
- RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,
- InputBuffer,
+ RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,
+ InputBuffer,
InputBufferLength);
}
-
+
/* Write the flags */
Irp->Flags = IRP_BUFFERED_IO | IRP_DEALLOCATE_BUFFER;
if (OutputBuffer) Irp->Flags |= IRP_INPUT_OPERATION;
-
+
/* Save the Buffer */
Irp->UserBuffer = OutputBuffer;
}
if (InputBuffer)
{
/* Allocate the System Buffer */
- Irp->AssociatedIrp.SystemBuffer = ExAllocatePoolWithTag(NonPagedPool,
- InputBufferLength,
+ Irp->AssociatedIrp.SystemBuffer = ExAllocatePoolWithTag(NonPagedPool,
+ InputBufferLength,
TAG_SYS_BUF);
/* Fail if we couldn't */
IoFreeIrp(Irp);
return(NULL);
}
-
+
/* Copy into the System Buffer */
- RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,
- InputBuffer,
+ RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,
+ InputBuffer,
InputBufferLength);
-
+
/* Write the flags */
Irp->Flags = IRP_BUFFERED_IO | IRP_DEALLOCATE_BUFFER;
}
{
Irp->Flags = 0;
}
-
+
/* Check if we got an output buffer */
if (OutputBuffer)
{
IoFreeIrp(Irp);
return NULL;
}
-
+
/* Probe and Lock */
- _SEH_FILTER(FreeAndGoOn)
- {
- /* Free the MDL and IRP */
- IoFreeMdl(Irp->MdlAddress);
- IoFreeIrp(Irp);
- return EXCEPTION_CONTINUE_SEARCH;
- }
- _SEH_TRY_FILTER(FreeAndGoOn)
+ _SEH_TRY
{
/* Use the right Access Type */
if (IO_METHOD_FROM_CTL_CODE(IoControlCode) == METHOD_IN_DIRECT)
{
AccessType = IoWriteAccess;
}
-
+
/* Do the probe */
MmProbeAndLockPages(Irp->MdlAddress, KernelMode, AccessType);
}
_SEH_HANDLE
{
- return NULL;
+ /* Free the MDL and IRP */
+ IoFreeMdl(Irp->MdlAddress);
+ IoFreeIrp(Irp);
+ /* FIXME - pass the exception to the caller? */
+ Irp = NULL;
}
_SEH_END;
+
+ if (!Irp)
+ return NULL;
}
break;
StackPtr->Parameters.DeviceIoControl.Type3InputBuffer = InputBuffer;
break;
}
-
+
/* Now write the Event and IoSB */
if (!IoStatusBlock) KEBUGCHECK(0); /* Temporary to catch illegal ROS Drivers */
Irp->UserIosb = IoStatusBlock;
/* Sync IRPs are queued to requestor thread's irp cancel/cleanup list */
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
IoQueueThreadIrp(Irp);
-
+
/* Return the IRP */
return Irp;
}
}
/* There can only be one Bugcheck per Bootup */
- if (!InterlockedDecrement(&KeBugCheckCount)) {
+ if (!InterlockedDecrement((PLONG)&KeBugCheckCount)) {
#ifdef CONFIG_SMP
ULONG i;
LONG OldValue;
/* Increase the contention count */
- InterlockedIncrement(&GuardedMutex->Contention);
+ InterlockedIncrement((PLONG)&GuardedMutex->Contention);
/* Start by unlocking the Guarded Mutex */
BitsToRemove = GM_LOCK_BIT;
PMM_SECTION_SEGMENT pssSegments;
Elf_Addr nImageBase = 0;
Elf_Addr nEntryPoint;
- ULONG32 nPrevVirtualEndOfSegment;
+ ULONG32 nPrevVirtualEndOfSegment = 0;
ULONG i;
ULONG j;
{
KEBUGCHECK(0);
}
- InterlockedExchange(Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY)));
+ InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY)));
MiFlushTlb(Pt, Address);
}
}
else
{
ULONG Entry;
- Entry = InterlockedExchange(ADDR_TO_PTE(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE);
+ Entry = InterlockedExchange((PLONG)ADDR_TO_PTE(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE);
Pfn = PTE_TO_PFN(Entry);
}
FLUSH_TLB_ONE(Address);
else
{
ULONG Entry;
- Entry = InterlockedExchange(ADDR_TO_PTE(Address), 0);
+ Entry = InterlockedExchange((PLONG)ADDR_TO_PTE(Address), 0);
Pfn = PTE_TO_PFN(Entry);
}
FLUSH_TLB_ONE(Address);
if(AccessMode != KernelMode)
{
+ RtlZeroMemory(&AttributesCopy, sizeof(AttributesCopy));
+
_SEH_TRY
{
ProbeForRead(ObjectAttributes,
if(AttributesCopy.SecurityQualityOfService != NULL)
{
SECURITY_QUALITY_OF_SERVICE SafeQoS;
+
+ RtlZeroMemory(&SafeQoS, sizeof(SafeQoS));
_SEH_TRY
{
if(AccessMode != KernelMode)
{
+ RtlZeroMemory(&OriginalCopy, sizeof(OriginalCopy));
+
_SEH_TRY
{
/* probe the ObjectName structure and make a local stack copy of it */
else
{
PWSTR StrSource = NULL;
+
+ RtlZeroMemory(&LocalDest, sizeof(LocalDest));
/* create a DstPath structure on the stack */
_SEH_TRY
PROCESS_SESSION_INFORMATION SessionInfo;
Status = STATUS_SUCCESS;
+ RtlZeroMemory(&SessionInfo, sizeof(SessionInfo));
+
_SEH_TRY
{
/* copy the structure to the stack */
if(CurrentMode == UserMode)
{
+ RtlZeroMemory(&Src, sizeof(Src));
+
_SEH_TRY
{
ProbeForRead(UnsafeSrc,
{
if(CurrentMode != KernelMode)
{
+ RtlZeroMemory(&DescriptorCopy, sizeof(DescriptorCopy));
+
_SEH_TRY
{
/* first only probe and copy until the control field of the descriptor
TCHAR *szCurPath, /* [IN] Full path of current directory */
LPDIRSWITCHFLAGS lpFlags) /* [IN] The flags used */
{
- USHORT iScreenWidth;
+ SHORT iScreenWidth;
USHORT iColumns;
USHORT iLines;
INT iLongestName;
DH_DbgPrint(MID_TRACE,("Got Key %x\n", ValueKey));
if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
- SubOut, &SubOutLen )) != ERROR_SUCCESS )
+ (LPBYTE)SubOut, &SubOutLen )) != ERROR_SUCCESS )
goto regerror;
DH_DbgPrint(MID_TRACE,("Value %s has size %d\n", Value, SubOutLen));
goto regerror;
if( (Error = RegQueryValueEx( ValueKey, Value, NULL, NULL,
- SubOut, &SubOutLen )) != ERROR_SUCCESS )
+ (LPBYTE)SubOut, &SubOutLen )) != ERROR_SUCCESS )
goto regerror;
DH_DbgPrint(MID_TRACE,("Value %s is %s\n", Value, SubOut));
MIB_IPFORWARDROW DefGatewayRow;
Adapter->DhclientState.config = &Adapter->DhclientConfig;
- strncpy(Adapter->DhclientInfo.name, Adapter->IfMib.bDescr,
+ strncpy(Adapter->DhclientInfo.name, (char*)Adapter->IfMib.bDescr,
sizeof(Adapter->DhclientInfo.name));
AdapterKey = FindAdapterKey( Adapter );
* Recheck the +1 below.
*/
RegSetValueEx( RegKey, "NameServer", 0, REG_SZ,
- nsbuf, strlen(nsbuf) + 1 );
+ (LPBYTE)nsbuf, strlen(nsbuf) + 1 );
free( nsbuf );
}
struct client_config DhclientConfig;
struct sockaddr_in ListenAddr;
unsigned int BindStatus;
- char recv_buf[1];
+ unsigned char recv_buf[1];
} DHCP_ADAPTER, *PDHCP_ADAPTER;
#include <rosdhcp_public.h>
ASSERT(SharedSectionPool && Process && SystemMappedBase && UserMappedBase);
SectionObject = NULL;
+ SharedSection = NULL;
ExAcquireFastMutex(&SharedSectionPool->Lock);
ULONG_PTR DataPtr;
UINT PaletteEntryCount;
PBITMAPOBJ BitmapObject;
- UINT PaletteType;
+ INT PaletteType;
if (BitmapInfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER))
{
static WORD *to_upper_org = NULL, *to_lower_org = NULL;
+#if 0
static WORD diffs[256];
static int number_of_diffs;
+#endif
static WORD number_of_subtables_with_diffs;
/* pointers to subtables with 16 elements in each to the main table */
static void test_packed_table(WCHAR *table)
{
- WCHAR test_str[] = L"This is an English text. Ïî-ðóññêè ÿ ïèñàòü óìåþ íåìíîæêî. 1234567890";
+ WCHAR test_str[] = L"This is an English text. \x0CF\x0EE-\x0F0\x0F3\x0F1\x0F1\x0EA\x0E8 \x0FF \x0EF\x0E8\x0F1\x0E0\x0F2\x0FC \x0F3\x0EC\x0E5\x0FE \x0ED\x0E5\x0EC\x0ED\x0EE\x0E6\x0EA\x0EE. 1234567890";
//WORD diff, off;
//WORD *sub_table;
DWORD i, len;
return TRUE;
}
+#if 0
static int find_diff(WORD diff)
{
int i;
return -1;
}
+#endif
static WORD find_subtable_with_diffs(WORD *table, WORD *subtable)
{
USHORT ClassSize;
/* Name of key (not zero terminated) */
- UCHAR Name[0];
+ CHAR Name[0];
} GCC_PACKED KEY_CELL, *PKEY_CELL;
/* KEY_CELL.Type constants */
ULONG DataType;
USHORT Flags;
USHORT Unused1;
- UCHAR Name[0]; /* warning : not zero terminated */
+ CHAR Name[0]; /* warning : not zero terminated */
} GCC_PACKED VALUE_CELL, *PVALUE_CELL;
/* VALUE_CELL.Flags constants */
typedef struct _DATA_CELL
{
LONG CellSize;
- UCHAR Data[0];
+ CHAR Data[0];
} GCC_PACKED DATA_CELL, *PDATA_CELL;
#ifdef _MSC_VER
ULONG SrcDataSize;
ULONG DstDataSize;
ULONG DataType;
- PUCHAR Data;
+ PCHAR Data;
BOOL Expand = FALSE;
DPRINT ("CmiExportValue('%s') called\n", (Value == NULL) ? "<default>" : (PCHAR)Value->Name);
BOOL
InfGetBinaryField (PINFCONTEXT Context,
ULONG FieldIndex,
- PUCHAR ReturnBuffer,
+ PCHAR ReturnBuffer,
ULONG ReturnBufferSize,
PULONG RequiredSize)
{
PINFCACHEFIELD CacheField;
ULONG Index;
ULONG Size;
- PUCHAR Ptr;
+ PCHAR Ptr;
if (Context == NULL || Context->Line == NULL || FieldIndex == 0)
{
Ptr = ReturnBuffer;
while (CacheField != NULL)
{
- *Ptr = (UCHAR)strtoul (CacheField->Data, NULL, 16);
+ *Ptr = (CHAR)strtoul (CacheField->Data, NULL, 16);
Ptr++;
CacheField = CacheField->Next;
BOOL
InfGetBinaryField (PINFCONTEXT Context,
ULONG FieldIndex,
- PUCHAR ReturnBuffer,
+ PCHAR ReturnBuffer,
ULONG ReturnBufferSize,
PULONG RequiredSize);
Error = RegQueryValue (KeyHandle,
ValueName,
NULL,
- (PUCHAR)Buffer,
+ (PCHAR)Buffer,
&Size);
if (Error != ERROR_SUCCESS)
goto done;
RegSetValue (KeyHandle,
ValueName,
REG_MULTI_SZ,
- (PUCHAR)Buffer,
+ (PCHAR)Buffer,
Total);
}
}
else /* get the binary data */
{
- PUCHAR Data = NULL;
+ PCHAR Data = NULL;
if (!InfGetBinaryField (Context, 5, NULL, 0, &Size))
Size = 0;
RootKey->ValueCount = 0;
RootKey->NameSize = 2;
- RootKey->Name = (PUCHAR)malloc(2);
+ RootKey->Name = (PCHAR)malloc(2);
strcpy(RootKey->Name, "\\");
RootKey->DataType = 0;
RegSetValue(LinkKey,
NULL,
REG_LINK,
- (PUCHAR)&ControlSetKey,
+ (PCHAR)&ControlSetKey,
sizeof(PVOID));
/* Create HARDWARE key */
RegSetValue(HKEY Key,
PCHAR ValueName,
ULONG Type,
- PUCHAR Data,
+ PCHAR Data,
ULONG DataSize)
{
PLIST_ENTRY Ptr;
if ((ValueName == NULL) || (*ValueName == 0))
{
/* set default value */
- if ((Key->Data != NULL) && (Key->DataSize > sizeof(PUCHAR)))
+ if ((Key->Data != NULL) && (Key->DataSize > sizeof(PCHAR)))
{
free(Key->Data);
}
- if (DataSize <= sizeof(PUCHAR))
+ if (DataSize <= sizeof(PCHAR))
{
Key->DataSize = DataSize;
Key->DataType = Type;
}
else
{
- Key->Data = (PUCHAR)malloc(DataSize);
+ Key->Data = (PCHAR)malloc(DataSize);
Key->DataSize = DataSize;
Key->DataType = Type;
memcpy(Key->Data, Data, DataSize);
}
/* set new value */
- if ((Value->Data != NULL) && (Value->DataSize > sizeof(PUCHAR)))
+ if ((Value->Data != NULL) && (Value->DataSize > sizeof(PCHAR)))
{
free(Value->Data);
}
- if (DataSize <= sizeof(PUCHAR))
+ if (DataSize <= sizeof(PCHAR))
{
Value->DataSize = DataSize;
Value->DataType = Type;
}
else
{
- Value->Data = (PUCHAR)malloc(DataSize);
+ Value->Data = (PCHAR)malloc(DataSize);
if (Value->Data == NULL)
return(ERROR_OUTOFMEMORY);
Value->DataType = Type;
RegQueryValue(HKEY Key,
PCHAR ValueName,
PULONG Type,
- PUCHAR Data,
+ PCHAR Data,
PULONG DataSize)
{
ULONG Size;
*Type = Key->DataType;
if ((Data != NULL) && (DataSize != NULL))
{
- if (Key->DataSize <= sizeof(PUCHAR))
+ if (Key->DataSize <= sizeof(PCHAR))
{
Size = min(Key->DataSize, *DataSize);
memcpy(Data, &Key->Data, Size);
*Type = Value->DataType;
if ((Data != NULL) && (DataSize != NULL))
{
- if (Value->DataSize <= sizeof(PUCHAR))
+ if (Value->DataSize <= sizeof(PCHAR))
{
Size = min(Value->DataSize, *DataSize);
memcpy(Data, &Value->Data, Size);
Value->Name = NULL;
Value->NameSize = 0;
- if (Value->DataSize > sizeof(PUCHAR))
+ if (Value->DataSize > sizeof(PCHAR))
{
if (Value->Data != NULL)
free(Value->Data);
PCHAR ValueName,
PULONG NameSize,
PULONG Type,
- PUCHAR Data,
+ PCHAR Data,
PULONG DataSize)
{
PLIST_ENTRY Ptr;
ULONG ValueCount;
USHORT NameSize;
- PUCHAR Name;
+ PCHAR Name;
/* default data */
ULONG DataType;
ULONG DataSize;
- PUCHAR Data;
+ PCHAR Data;
} KEY, *HKEY, **PHKEY;
/* value name */
ULONG NameSize;
- PUCHAR Name;
+ PCHAR Name;
/* value data */
ULONG DataType;
ULONG DataSize;
- PUCHAR Data;
+ PCHAR Data;
} VALUE, *PVALUE;
RegSetValue(HKEY Key,
PCHAR ValueName,
ULONG Type,
- PUCHAR Data,
+ PCHAR Data,
ULONG DataSize);
LONG
RegQueryValue(HKEY Key,
PCHAR ValueName,
PULONG Type,
- PUCHAR Data,
+ PCHAR Data,
PULONG DataSize);
LONG
PCHAR ValueName,
PULONG NameSize,
PULONG Type,
- PUCHAR Data,
+ PCHAR Data,
PULONG DataSize);
USHORT
converted_name[1] = 0x00;
- value = lhash_val_of_name_sys(typelib->typelib_header.varflags & 0x0f, typelib->typelib_header.lcid, converted_name + 4);
+ value = lhash_val_of_name_sys(typelib->typelib_header.varflags & 0x0f, typelib->typelib_header.lcid, (LPCSTR)converted_name + 4);
converted_name[2] = value;
converted_name[3] = value >> 8;
}
else
{
- char *p = xmalloc( (strlen(file_pos) + 1) );
+ char *p = xmalloc( (strlen((char*)file_pos) + 1) );
str->str = p;
str->id = 0;
while ((*p++ = get_byte()));
get_dword(); /* skip version */
get_dword(); /* skip characteristics */
- file_pos = (const char *)res->data + res->data_size;
+ file_pos = (const unsigned char *)res->data + res->data_size;
if (file_pos > file_end) fatal_error( "%s is a truncated file\n", file_name );
}
* Remarks : No codepage translation is done.
*****************************************************************************
*/
-static char *strncpyWtoA(char *cs, const short *ws, int maxlen)
+static char *strncpyWtoA(char *cs, WCHAR *ws, int maxlen)
{
char *cptr = cs;
- const short *wsMax = ws + maxlen - 1;
+ WCHAR *wsMax = ws + maxlen - 1;
while(*ws && ws < wsMax)
{
- if(*ws < -128 || *ws > 127)
+ if((short)*ws < -128 || (short)*ws > 127)
fprintf(stderr, "***Warning: Unicode string contains non-printable chars***\n");
*cptr++ = (char)*ws++;
}
if(nid->type == name_str && nid->name.s_name->type == str_unicode)
{
- short *sptr;
+ WCHAR *sptr;
int i;
sptr = nid->name.s_name->str.wstr;
buf[0] = '\0';
str = new_string();
str->type = str_unicode;
str->size = (idx - tag) / 2;
- str->str.wstr = (short *)xmalloc(idx-tag+2);
+ str->str.wstr = (WCHAR *)xmalloc(idx-tag+2);
memcpy(str->str.wstr, &res->data[tag], idx-tag);
str->str.wstr[str->size] = 0;
type = new_name_id();
str = new_string();
str->type = str_unicode;
str->size = (idx - tag) / 2;
- str->str.wstr = (short *)xmalloc(idx-tag+2);
+ str->str.wstr = (WCHAR *)xmalloc(idx-tag+2);
memcpy(str->str.wstr, &res->data[tag], idx-tag);
str->str.wstr[str->size] = 0;
name = new_name_id();