This below code doesn't work !
...
lea edi,bufentry
push SIZEOF RASENTRYNAMEA ;** wrong **
pop (RASENTRYNAMEA PTR ).dwSize
invoke RasEnumEntries,NULL,NULL,ADDR bufentry,ADDR lpcb,ADDR lpcEntries
...
-----------------
If I replace :
- push 108h ;==> This code works well !!!
for
- push SIZEOF RASENTRYNAMEA ;
; When I debugged this command, I saw it is changed
; to "push 105h". It means SIZEOF RASENTRYNAMEA = 105h
Do anyone know what wrong it is here ?
RAS_MaxEntryName EQU 256
RASENTRYNAMEA STRUCT
dwSize dd ?
szEntryName db RAS_MaxEntryName + 1 dup(?)
RASENTRYNAMEA ENDS
This means SIZEOF RASENTRYNAMEA is
4 + 256 + 1 = 261 ==> 105H
So... what doesn't 'work'?
Are you trying to run on Win2k?
There's apparently two extra fields needed in RASENTRYNAME for it.
typedef struct _RASENTRYNAME {
DWORD dwSize;
TCHAR szEntryName;
#if (WINVER >= 0x500)
DWORD dwFlags;
CHAR szPhonebookPath;
#endif
} RASENTRYNAME;
Check the return code of RasEnumEntries.
; dw_Size parameter of the RASDIALPARAMS structure is 041Ch, not 0419h !?
; dw_Size parameter of the RASENTRYNAME structure is 0108h, not 0105h !?
; dw_Size parameter of the RASCONN structure is 019Ch, not 019Bh !?
; dw_Size parameter of the RASCONNSTATUS structure is 00A0h, not 009Eh !?
Currently I don't know why, but that's the way it works.
Test
Thanks all !
Finally, I knew what wrong !
If I declare the structure like this :
RASENTRYNAMEA STRUCT DWORD
dwSize dd ?
szEntryName db RAS_MaxEntryName + 1 dup(?)
RASENTRYNAMEA END
It works well ! Because RAS Functions require DWORD boundary to align this structrue.
Sorry for my bad english.