Jump to content

Is it a Bug?


 Share

Recommended Posts

Hello there ...

I am getting 2 from @error after calling this call.

The documentations means:

@error = 2 unknown "return type".

Func showVar($var, $name="unnamed")
        
        $tmp = "--------------------------------" & @CRLF
        
        If IsArray($var) Then
            For $i = 0 To UBound
                $tmp &= "   #" & $i & ": " & $tmp[$i]
            Next
        Else
            $tmp &= $name & ": " & $var
        EndIf
        
        Return $tmp
        
    EndFunc

    Func _NetLocalGroupEnum($servername="", $level=0)

        Local $arr[1]

    ;   NET_API_STATUS NetLocalGroupEnum(
    ;     LPCWSTR servername,
    ;     DWORD level,
    ;     LPBYTE* bufptr,
    ;     DWORD prefmaxlen,
    ;     LPDWORD entriesread,
    ;     LPDWORD totalentries,
    ;     PDWORD_PTR resume_handle
    ;   );

            
        If $level = 0 Then
            $bufptr = DllStructCreate("ptr")    ; GROUP_INFO_0
        Else
            MsgBox(0, "", "failed!")
        EndIf
        
        $hresume        = DllStructCreate("ptr")
        $entriesread    = 0
        $totalentries   = 0
        
        $res = DllCall( "netapi32.dll", "long", "NetLocalGroupEnum", _
                        "wstr", $servername, _
                        "int", $level, _
                        "long", DllStructGetPtr($bufptr), _
                        "int", -1, _
                        "ptr_int", $entriesread, _
                        "ptr_int", $totalentries, _
                        "long", DllStructGetPtr($hresume) _
                        )
                        
    ;#cs
        MsgBox(0, "",   "@error: " & @error & @CRLF & _
                        showVar($res, "res") )
    ;#ce            

    EndFunc

    _NetLocalGroupEnum()

Does anybody know whats wrong? I looked for NET_API_STATUS a it should be and long value. See here for example.

MSDN Library & NetLocalGroupEnum

Link to comment
Share on other sites

  • Developers

Hello there ...

I am getting 2 from @error after calling this call.

<{POST_SNAPBACK}>

"ptr_int" is not a valid value..... Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...