#include <debug.h>
#include <mm.h>
-BOOL IniOpenSection(PUCHAR SectionName, U32* SectionId)
+BOOL IniOpenSection(PCHAR SectionName, ULONG* SectionId)
{
PINI_SECTION Section;
if (stricmp(SectionName, Section->SectionName) == 0)
{
// We found it
- *SectionId = (U32)Section;
+ *SectionId = (ULONG)Section;
DbgPrint((DPRINT_INIFILE, "IniOpenSection() Found it! SectionId = 0x%x\n", SectionId));
return TRUE;
}
return FALSE;
}
-U32 IniGetNumSectionItems(U32 SectionId)
+ULONG IniGetNumSectionItems(ULONG SectionId)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
return Section->SectionItemCount;
}
-U32 IniGetSectionSettingNameSize(U32 SectionId, U32 SettingIndex)
+ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
return (strlen(Section->SectionItemList[SettingIndex].ItemName) + 1);
}
-U32 IniGetSectionSettingValueSize(U32 SectionId, U32 SettingIndex)
+ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
return (strlen(Section->SectionItemList[SettingIndex].ItemValue) + 1);
}
-BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName, U32 NameSize, PUCHAR SettingValue, U32 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;
#ifdef DEBUG
- U32 RealSettingNumber = SettingNumber;
+ ULONG RealSettingNumber = SettingNumber;
#endif
DbgPrint((DPRINT_INIFILE, ".001 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
return FALSE;
}
-BOOL IniReadSettingByName(U32 SectionId, PUCHAR SettingName, PUCHAR Buffer, U32 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, U32* SectionId)
+BOOL IniAddSection(PCHAR SectionName, ULONG* SectionId)
{
PINI_SECTION Section;
RtlListInsertTail((PLIST_ITEM)IniFileSectionListHead, (PLIST_ITEM)Section);
}
- *SectionId = (U32)Section;
+ *SectionId = (ULONG)Section;
return TRUE;
}
-BOOL IniAddSettingValueToSection(U32 SectionId, PUCHAR SettingName, PUCHAR SettingValue)
+BOOL IniAddSettingValueToSection(ULONG SectionId, PCHAR SettingName, PCHAR SettingValue)
{
PINI_SECTION Section = (PINI_SECTION)SectionId;
PINI_SECTION_ITEM SectionItem;
RtlZeroMemory(SectionItem, sizeof(INI_SECTION_ITEM));
// Allocate the setting name buffer
- SectionItem->ItemName = MmAllocateMemory(strlen(SettingName));
+ SectionItem->ItemName = MmAllocateMemory(strlen(SettingName) + 1);
if (!SectionItem->ItemName)
{
MmFreeMemory(SectionItem);
}
// Allocate the setting value buffer
- SectionItem->ItemValue = MmAllocateMemory(strlen(SettingValue));
+ SectionItem->ItemValue = MmAllocateMemory(strlen(SettingValue) + 1);
if (!SectionItem->ItemValue)
{
MmFreeMemory(SectionItem->ItemName);