flat assembler
Message board for the users of flat assembler.

Index > Windows > RasDial problem

Author
Thread Post new topic Reply to topic
inskipp



Joined: 23 Jun 2003
Posts: 25
Location: Poland
inskipp
I'm trying to use the RasDial function, but it returns ERROR_BUFFER_INVALID.
I think the problem is in RASDIALPARAMS declaration, becose I have the same problem with RasGetEntryDialParams fuction.
Here is part of my code:

Code:
     mov     edi,rasdialparams
   xor     eax,eax
     mov     ecx,sizeof.RASDIALPARAMS
    rep     stosb
       
    mov     [rasdialparams.dwSize],sizeof.RASDIALPARAMS
 ;mov    [rasdialparams.szPhoneNumber],'*'
 invoke  lstrcpy,rasdialparams.szEntryName,_entryname
        invoke  lstrcpy,rasdialparams.szUserName,_user
      invoke  lstrcpy,rasdialparams.szPassword,_pass
      
    lea     eax,[.hConn]
        mov     dword[eax],0
        invoke  RasDial,0,0,rasdialparams,0,0,eax

(...)
rasdialparams RASDIALPARAMS
    


and the RASDIALPARAMS definition (taken from a ras.h file):

Code:
RAS_MaxDeviceName     =128
RAS_MaxDeviceType     =16
RAS_MaxEntryName      =256
RAS_MaxPhoneNumber    =128
RAS_MaxAreaCode       =10
RAS_MaxPadType        =32
RAS_MaxX25Address     =200
RAS_MaxFacilities     =200
RAS_MaxUserData       =200
RAS_MaxDnsSuffix      =256
RAS_MaxCallbackNumber =RAS_MaxPhoneNumber

UNLEN              = 256
PWLEN          = 256
DNLEN          = 15

struc RASDIALPARAMS
{  
  .dwSize                dd ?
  .szEntryName          rb RAS_MaxEntryName+1 
  .szPhoneNumber      rb RAS_MaxPhoneNumber+1
  .szCallbackNumber  rb RAS_MaxCallbackNumber+1 
  .szUserName            rb UNLEN + 1
  .szPassword           rb PWLEN + 1
  .szDomain             rb DNLEN + 1
  .dwSubEntry           dd ?
  .dwCallbackId         dd ?
}
struct RASDIALPARAMS
    


Maybe someone used this fuction bedore, or see an error in my code.
Post 16 Oct 2004, 11:53
View user's profile Send private message ICQ Number Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Try delete { and } symbols in RASDIALPARAMS struct.

e.g.:
Code:
struc RASDIALPARAMS
  .dwSize               dd ?
  .szEntryName          rb RAS_MaxEntryName+1 
  .szPhoneNumber        rb RAS_MaxPhoneNumber+1
  .szCallbackNumber     rb RAS_MaxCallbackNumber+1 
  .szUserName           rb UNLEN + 1
  .szPassword           rb PWLEN + 1
  .szDomain             rb DNLEN + 1
  .dwSubEntry           dd ?
  .dwCallbackId         dd ?
ends
    
Post 16 Oct 2004, 12:18
View user's profile Send private message Reply with quote
inskipp



Joined: 23 Jun 2003
Posts: 25
Location: Poland
inskipp
I downloaded FASM 1.48 with the new macro set, change it in that way, but it still returns ERROR_BUFFER_INVALID. The problem must be somewhere else.
Post 16 Oct 2004, 13:03
View user's profile Send private message ICQ Number Reply with quote
inskipp



Joined: 23 Jun 2003
Posts: 25
Location: Poland
inskipp
I invoked RasDial with the RASDIALPARAMS initialized from 1 byte to 4096.
It works, when it's 736 or 1052 .
In my case sizeof.RASDIALPARAMS=1057, so my structure is 5 bytes to long, but I don't now why.
Post 16 Oct 2004, 15:08
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.