Jump to content

IniReadSectionNames odd behavior


Akton
 Share

Recommended Posts

I was testing IniReadSectionNames

and started by using the example from the manual

$var = IniReadSectionNames(@WindowsDir & "\win.ini")
If @error Then 
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $var[0]
        MsgBox(4096, "", $var[$i])
    Next
EndIf

But it returns sections which are NOT in the win.ini files? (Things like "Aedebug" or "Colors")

I checked the path, which was C:\windows\win.ini opened it in an editor and the headers i checked weren't in the file.

Then i tried copying the win.ini file from windows to c:\ and changed the test to read it from there - and THEN it showed the section names in the win.ini file??

Why is that? Is that a bug or something I don't know about?

Link to comment
Share on other sites

I was testing IniReadSectionNames

and started by using the example from the manual

$var = IniReadSectionNames(@WindowsDir & "\win.ini")
If @error Then 
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $var[0]
        MsgBox(4096, "", $var[$i])
    Next
EndIf

But it returns sections which are NOT in the win.ini files? (Things like "Aedebug" or "Colors")

I checked the path, which was C:\windows\win.ini opened it in an editor and the headers i checked weren't in the file.

Then i tried copying the win.ini file from windows to c:\ and changed the test to read it from there - and THEN it showed the section names in the win.ini file??

Why is that? Is that a bug or something I don't know about?

"

Starting with NT based versions of Windows, OS ini files were remapped to the registry, which is also where the "Aedebug" and other values that aren't in the actual ini file are coming from. You can find the remappings in the registry at

"HKEY_LOCAL_MACHINE \Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping"

API calls (including those used by AutoIt's Ini functions) to read and write OS ini files are redirected to the registry.

Moving or changing the name of the OS ini files causes them to be seen as regular ini files so no registry redirect occurs when reading/writing them.

More info here: http://technet.microsoft.com/en-us/library/cc722567.aspx

and here: http://support.microsoft.com/kb/102889

Link to comment
Share on other sites

"

Starting with NT based versions of Windows, OS ini files were remapped to the registry, which is also where the "Aedebug" and other values that aren't in the actual ini file are coming from. You can find the remappings in the registry at

"HKEY_LOCAL_MACHINE \Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping"

Ahh. Good explanation ResNullius - perhaps that should be included in the help file so as not to confuse others :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...