News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Using the connections dialog box , Help

Started by ToutEnMasm, November 20, 2006, 04:46:04 PM

Previous topic - Next topic

ToutEnMasm

Thanks,
This enum the dial-up connections ,There is a little problem here :

;modify code
      invoke RasEnumEntries, NULL, NULL, lpRasEntryName, ADDR dwCb, ADDR dwEntries
.if eax == ERROR_BUFFER_TOO_SMALL
      jmp AllocateRasEntryNameLoop
.elseif eax == ERROR_NOT_ENOUGH_MEMORY
      jmp RetFail
.elseif eax != 0
jmp RetFail
.endif

ragdog

yes i say it :U

i wanted a RasHangUp source for adsl can help you?

ragdog

i have tested this works



[attachment deleted by admin]

ToutEnMasm

Hello,
There is something strange with the size of the structure RASENTRYNAME.
Yours,that work
Quote
    RASENTRYNAME5A STRUCT
        dwSize dd ?
        szEntryName db 260 dup(?)
        dwFlags dd ?
        szPhonebookPath db 264 dup(?)
    RASENTRYNAME5A ENDS

and the one of the sdk , don't work

Quote
RASENTRYNAME   STRUCT
   dwSize DWORD ?
   szEntryName BYTE RAS_MaxEntryName + 1 dup (?) ;256+1=257
IF (COMPARE (WINVER,GE,0500h))   ;exclude 95 98
   dwFlags DWORD ?
   szPhonebookPath BYTE MAX_PATH + 1 dup (?)  ;260 +1 =261
ENDIF
RASENTRYNAME      ENDS

MSDN say there is a bug for that only on windows CE (use of 10 structures to avoid it)
Where did you find the correct answer ?.
                                 ToutEnMasm






ToutEnMasm


Found what is the problem,
The structure must be align 4 ,SDK (ras.h) and must be write as this
Quote
RASENTRYNAME   STRUCT 4
   dwSize DWORD ?
   szEntryName BYTE RAS_MaxEntryName + 1 dup (?) 
;IF (COMPARE (WINVER,GE,0500h))   ;exclus 95 98
   dwFlags DWORD ?
   szPhonebookPath BYTE MAX_PATH + 1 dup (?)  ;260
ENDIF
TRASENTRYNAME      ENDS

write like that sizeof RASENTRYNAME return the correct size and the function RasEnumEntries don't return an ERROR_INVALID_SIZE (278h).

                                                  ToutEnMasm