The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: ToutEnMasm on November 20, 2006, 04:46:04 PM

Title: Using the connections dialog box , Help
Post by: ToutEnMasm on November 20, 2006, 04:46:04 PM

I search how to connect the internet using the connections dialog box that have all the needed paramaters in them.
Is someone have an idea or a source code ?
                                  ToutEnMasm
Title: Re: Using the connections dialog box , Help
Post by: Tedd on November 20, 2006, 07:12:37 PM
Which dialog box?
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 21, 2006, 08:53:25 AM

It's the dialog box that appear with "InternetGoOnline",the function don't use the defaut url that is defined in the "networks connexions ".
The dialog box ask you if you want to connect or not.
I am searching how to connect using the defaut url.
                             ToutEnMasm

                   
Title: Re: Using the connections dialog box , Help
Post by: Tedd on November 21, 2006, 01:40:56 PM
I think the url will be stored in the registry along with the other settings for the connection through your internet service provider. If you get the string for the url then you can pass it to the InternetGoOnline function and it will use that url - which will be what internet explorer does if it tries to open a (different) url but finds the computer is not online. So if you open a url and the computer is not online, this dialog should pop-up automatically?
As for finding the isp-url, I don't know where to start. I assume there will be a standard key that points to the current internet connection settings (for the isp), so you follow that and get the correct keys/settings that way. Hmmm..
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 21, 2006, 02:25:09 PM

seem to be in
Quote
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
value                                                    Start Page

If anyone have the same it must be good
                                          ToutEnMasm
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 21, 2006, 04:45:13 PM

This code open an internet communication with ..... No parameters.


.data
starturl db INTERNET_MAX_URL_LENGTH  dup  (0)   ;2048
.code
debut:
invoke LireBaseRegistre,addr starturl
invoke InternetGoOnline,addr starturl,NULL,NULL


invoke ExitProcess,NULL
;--------------------------------- SUB --------------------------
;################################################################
LireBaseRegistre PROC uses esi edi preponse:DWORD
Local  reponse:DWORD,dwtype:DWORD
Local  Hkey:DWORD,NbValues:DWORD
Local  Hsubkey:DWORD
Local  TailleClassCle:DWORD,NbBytes
LOCAL  SousCle[MAX_PATH]:BYTE
Local  retour:DWORD
ZEROLOCALES retour

;KeyPath db "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main",0
;KeyValue db "Start Page",0
invoke RegCreateKeyEx,HKEY_CURRENT_USER,SADR ("Software"),NULL,\
NULL,REG_OPTION_NON_VOLATILE,KEY_READ, \
NULL,addr Hkey,addr reponse
.if eax != ERROR_SUCCESS
mov Hkey,0
jmp FindeLireBaseRegistre
.endif
invoke RegCreateKeyEx,Hkey,SADR ("Microsoft"),NULL,\
NULL,REG_OPTION_NON_VOLATILE,KEY_READ, \
NULL,addr Hsubkey,addr reponse
.if eax != ERROR_SUCCESS
jmp FindeLireBaseRegistre
.endif
invoke RegCloseKey,Hkey
PuPo Hkey,Hsubkey
invoke RegCreateKeyEx,Hkey,SADR ("Internet Explorer"),NULL,\
NULL,REG_OPTION_NON_VOLATILE,KEY_READ, \
NULL,addr Hsubkey,addr reponse
.if eax != ERROR_SUCCESS
jmp FindeLireBaseRegistre
.endif
invoke RegCloseKey,Hkey
PuPo Hkey,Hsubkey
invoke RegCreateKeyEx,Hkey,SADR ("Main"),NULL,\
NULL,REG_OPTION_NON_VOLATILE,KEY_READ, \
NULL,addr Hsubkey,addr reponse
.if eax != ERROR_SUCCESS
jmp FindeLireBaseRegistre
.endif
invoke RegCloseKey,Hkey
PuPo Hkey,Hsubkey
mov NbBytes,INTERNET_MAX_URL_LENGTH
invoke RegQueryValueEx,Hkey,SADR("Start Page"),NULL,addr dwtype,\
preponse,addr NbBytes
FindeLireBaseRegistre:
.if Hkey != 0
invoke RegCloseKey,Hkey
.endif
         mov eax,retour
         ret
LireBaseRegistre endp
Title: Re: Using the connections dialog box , Help
Post by: Tedd on November 21, 2006, 07:40:19 PM
That key gives the "Homepage" url, set by internet explorer.
Often this is set by the isp setup installer, but can easily be changed. I don't think it should be taken as the default 'connect' url.
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 22, 2006, 05:21:55 AM

another Idea ?
           ToutEnmasm
Title: Re: Using the connections dialog box , Help
Post by: Tedd on November 22, 2006, 11:56:21 AM
Sorry, my connection doesn't work the same way, so I can't check.
See if you can find the isp 'connection' url in another registry key? Or parts of it (which will be concatenated.)
There will be a place for isp settings, and it must be locatable in a standard way -- just need to find out where.
See if the isp cd-rom (or whatever they supllied) installer/sign-up stuff has any clues -- if this is what sets the keys, then you can try to find which ones it creates/modifies.
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 22, 2006, 04:02:40 PM

Hello,
I have a .isp  that send me to the key HKEY_CLASSES_ROOT\x-internet-signup
and the associated program is
%ProgramFiles%\Internet Explorer\Connection Wizard\ICWCONN1.EXE,0
Perhaps if you have a partial key name ?
                                    ToutEnMasm
Title: Re: Using the connections dialog box , Help
Post by: Tedd on November 22, 2006, 08:58:50 PM
Check if there are any settings in: Software\Microsoft\Internet Connection Wizard ?

Also check your windows directory (and subs) for files that might contain the settings from your isp.. (maybe "oemcust.*")

Sorry, not much clue ::)
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 22, 2006, 10:15:04 PM
Ok,
The file exist,perhaps something can be made with it but I don't know what ?.They are not readable
                              ToutEnMasm

Quote
C:\WINDOWS\system32\oobe\html>dir /B
ispsgnup
mouse
oemcust
oemhw
oemreg
iconnect
dslmain
isptype
sconnect
Title: Re: Using the connections dialog box , Help
Post by: ragdog on November 22, 2006, 10:22:29 PM
hi ToutEnMasm

wanted you a Dial-Up connection source??
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 23, 2006, 06:42:14 AM
Hello,

Ok post it ,it can be useful for many people.
If the source can be independant from the explorer ( not very easy to do) it would be perfect.
                   ToutEnMasm
Title: Re: Using the connections dialog box , Help
Post by: ragdog on November 23, 2006, 04:05:19 PM
here is the source works with adsl

greetz ragdog

[attachment deleted by admin]
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 23, 2006, 05:42:53 PM
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
Title: Re: Using the connections dialog box , Help
Post by: ragdog on November 23, 2006, 05:44:30 PM
yes i say it :U

i wanted a RasHangUp source for adsl can help you?
Title: Re: Using the connections dialog box , Help
Post by: ragdog on November 23, 2006, 05:49:43 PM
i have tested this works



[attachment deleted by admin]
Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 24, 2006, 09:13:29 AM
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





Title: Re: Using the connections dialog box , Help
Post by: ToutEnMasm on November 24, 2006, 10:18:42 AM

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