AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

create a DllCall based on help description

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Tue Nov 06, 2007 6:46 pm    Post subject: create a DllCall based on help description Reply with quote

Hi,

I need help to create a DllCall again. This is the definition I have from the help file that comes with the dll:
Quote:
DWORD __stdcall FSL2EnumLayerExclude(LPCSTR fslGUID, DWORD index, LPSTR excludePathBuffer, LPDWORD excludePathBufferLen, LPDWORD excludeType)

Enumerates the exclude entries for a layer

Return Value
Returns one of the following
FSL2_ERROR_SUCCESS On success
FSL2_ERROR_LAYER_NOT_FOUND When done

Parameters

fslGUID Identifies the layer.
index Index of exclude entry to enumerate
excludePathBuffer On success will point the value of the exclude entry
excludePathBufferLen Pointer to the size of the excludePathBuffer On success will contain the size of the string stored in ExcludePathBuffer
excludeType On success will contiant the type of exclude entry


This is what I got so far:
Code:
  Loop, 5
    {
      ID := A_Index
      VarSetCapacity(excludePathBuffer, 260)
      excludePathBufferLen = 000
      excludeType = 0
      RetVal := DllCall("fsllib32\FSL2EnumLayerExclude"
                      , "Str", fslGUID
                      , "UInt", ID
                      , "Str", excludePathBuffer
                      , "UInt *", excludePathBufferLen
                      , "UInt *", excludeType)
      excludes .= ID . " - " .  RetVal . " - " . excludePathBuffer . " - " . excludePathBufferLen . " - " . excludeType . "`n`"
    }
I'm sure that the fslGUID I use is valid since other dllcalls work fine. But the return value indicates that the layer is not found. Did I specify the parameter types wrong?
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Tue Nov 06, 2007 7:47 pm    Post subject: Reply with quote

Question
Code:

Loop, 5
    {
      ID := A_Index
      VarSetCapacity(excludePathBuffer, 260)
      excludePathBufferLen = 000
      excludeType = 0
      RetVal := DllCall("fsllib32\FSL2EnumLayerExclude"
                      , "Str", fslGUID
                      , "UInt", ID
                      , "Str *", excludePathBuffer
                      , "UInt *", excludePathBufferLen
                      , "UInt *", excludeType)
      excludes .= ID . " - " .  RetVal . " - " . excludePathBuffer . " - " . excludePathBufferLen . " - " . excludeType . "`n`"
    }


can you share the dll?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Tue Nov 06, 2007 9:39 pm    Post subject: Reply with quote

engunneer wrote:
can you share the dll?
Yes, It is belonging to SVS by Altiris. You can get the dll here.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Wed Nov 07, 2007 1:14 am    Post subject: Reply with quote

The syntax looks correct. So, obvious question: Have you loaded the library at the start-up, which may be necessary for this?
Code:
DllCall("LoadLibrary", "str", "fsllib32")

Or, you may have to specify the buffer length as input too:
Code:
excludePathBufferLen := VarSetCapacity(excludePathBuffer)
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Wed Nov 07, 2007 8:58 pm    Post subject: Reply with quote

Thanks Sean,

The last tip was the missing.


I got it working. Thanks a lot to all of you.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group