Jump to content

@OSServicePack help


Willow
 Share

Recommended Posts

I know how and what @OSServicePack returns in value, however can anyone tell me where it obtains the info from. I would imagine that it is stored in the registry...but which key?

This info would be much appreciated.

Thanks

Willow.

Link to comment
Share on other sites

Well knowing Valik I have serious doubts that it's getting that info from the registry. It's more apt to be from a call to the Windows API.

Valik hates code that relies on the registry.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

True, the macro itself most likely uses GetVersionEx() documented http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx

See http://www.autoitscript.com/forum/index.php?showtopic=86024&view=findpost&p=742429) for an AutoIt example.

$a=_GetVersionEx()
MsgBox(0,"",$a[4])

Func _GetVersionEx()
    Local $OsArray[5] = [""]
    Local $osvi = DllStructCreate("dword size;dword OsMajor;dword OsMinor;dword build;dword platform;char verString[128]")
    If @error Then
        Return SetError(@error, 1, 0)
    EndIf
    DllStructSetData($osvi, "size", 148)
    If @error Then
                $osvi = 0
        Return SetError(@error, 2, 0)
    EndIf
    Local $retVal = DllCall("Kernel32.dll", "int", "GetVersionExA", "ptr", DllStructGetPtr($osvi))
    If @error Then
                $osvi = 0
        Return SetError(@error, 3, 0)
    EndIf
    $OsArray[0] = String(DllStructGetData($osvi, "OsMajor"))
    $OsArray[1] = String(DllStructGetData($osvi, "OsMinor"))
    $OsArray[2] = String(DllStructGetData($osvi, "build"))
    $OsArray[3] = String(DllStructGetData($osvi, "platform"))
    $OsArray[4] = DllStructGetData($osvi, "verString")
        $osvi = 0
    Return $OsArray
EndFunc
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...