H
hq4000
I have a 32-bit C++ application built with Visual Studio 2005 in XP.
The application creates a dial-up connection entry into rasphone.pbk
successfully in 32-bit and 64-bit Vista. And the dial-up connection
works as expected. However, at the first run of the dial-up
connection, after the connection has been made, Vista pop-ups a
Network Location selection window asking to choose:
1. Home
2. Business
3. Public Location (the default)
After the selection, the corresponding setting would show up in
Network Connections as Network Category: private network (Home or
Business) or public network (Public Location).
It seems like my goal is to programmatically set the 'Network
Category' to prevent the network location selection popup during first
run. I am trying to manipulate the RASENTRY passed into the method
RasSetEntryProperties() and using INI setting to change some entries,
but no sure which parameters to change. Any help is appreciated.
Below is the initial rasphone.pbk before the first run.
[My DialUp Test (COM1)]
Encoding=1
Type=0
AutoLogon=0
UseRasCredentials=1
LowDateTime=1308709520
HighDateTime=29893380
DialParamsUID=3226093
Guid=B8BB572945C94743BE4E66C8A5233792
BaseProtocol=1
VpnStrategy=0
ExcludedProtocols=10
LcpExtensions=0
DataEncryption=8
SwCompression=0
NegotiateMultilinkAlways=0
SkipNwcWarning=0
SkipDownLevelDialog=0
SkipDoubleDialDialog=0
DialMode=0
OverridePref=15
RedialAttempts=0
RedialSeconds=0
IdleDisconnectSeconds=0
RedialOnLinkFailure=0
CallbackMode=0
CustomDialDll=
CustomDialFunc=
CustomRasDialDll=
ForceSecureCompartment=0
DisableIKENameEkuCheck=0
AuthenticateServer=0
ShareMsFilePrint=0
BindMsNetClient=0
SharedPhoneNumbers=1
GlobalDeviceSettings=0
PrerequisiteEntry=
PrerequisitePbk=
PreferredPort=COM1
PreferredDevice=My Test Modem
PreferredBps=0
PreferredHwFlow=0
PreferredProtocol=0
PreferredCompression=0
PreferredSpeaker=0
PreferredMdmProtocol=0
PreviewUserPw=0
PreviewDomain=0
PreviewPhoneNumber=0
ShowDialingProgress=0
ShowMonitorIconInTaskBar=1
CustomAuthKey=-1
AuthRestrictions=808
TypicalAuth=1
IpPrioritizeRemote=0
IpInterfaceMetric=0
fCachedDnsSuffix=0
IpHeaderCompression=0
IpAddress=0.0.0.0
IpDnsAddress=0.0.0.0
IpDns2Address=0.0.0.0
IpWinsAddress=0.0.0.0
IpWins2Address=0.0.0.0
IpAssign=1
IpNameAssign=1
IpDnsFlags=0
IpNBTFlags=1
TcpWindowSize=0
UseFlags=0
IpSecFlags=0
IpDnsSuffix=
IpCachedDnsSuffix=
Ipv6PrioritizeRemote=0
Ipv6InterfaceMetric=0
Ipv6NameAssign=1
Ipv6DnsAddress=::
Ipv6Dns2Address=::
Ipv6InterfaceId=0000000000000000
NETCOMPONENTS=
ms_msclient=0
ms_server=0
MEDIA=serial
Port=COM1
Device=My Test Modem
ConnectBPS=115200
DEVICE=modem
PhoneNumber=123
AreaCode=
CountryCode=0
CountryID=0
UseDialingRules=0
Comment=
LastSelectedPhone=0
PromoteAlternates=0
TryNextAlternateOnFail=1
HwFlowControl=0
Protocol=0
Compression=0
Speaker=1
MdmProtocol=0
The application creates a dial-up connection entry into rasphone.pbk
successfully in 32-bit and 64-bit Vista. And the dial-up connection
works as expected. However, at the first run of the dial-up
connection, after the connection has been made, Vista pop-ups a
Network Location selection window asking to choose:
1. Home
2. Business
3. Public Location (the default)
After the selection, the corresponding setting would show up in
Network Connections as Network Category: private network (Home or
Business) or public network (Public Location).
It seems like my goal is to programmatically set the 'Network
Category' to prevent the network location selection popup during first
run. I am trying to manipulate the RASENTRY passed into the method
RasSetEntryProperties() and using INI setting to change some entries,
but no sure which parameters to change. Any help is appreciated.
Below is the initial rasphone.pbk before the first run.
[My DialUp Test (COM1)]
Encoding=1
Type=0
AutoLogon=0
UseRasCredentials=1
LowDateTime=1308709520
HighDateTime=29893380
DialParamsUID=3226093
Guid=B8BB572945C94743BE4E66C8A5233792
BaseProtocol=1
VpnStrategy=0
ExcludedProtocols=10
LcpExtensions=0
DataEncryption=8
SwCompression=0
NegotiateMultilinkAlways=0
SkipNwcWarning=0
SkipDownLevelDialog=0
SkipDoubleDialDialog=0
DialMode=0
OverridePref=15
RedialAttempts=0
RedialSeconds=0
IdleDisconnectSeconds=0
RedialOnLinkFailure=0
CallbackMode=0
CustomDialDll=
CustomDialFunc=
CustomRasDialDll=
ForceSecureCompartment=0
DisableIKENameEkuCheck=0
AuthenticateServer=0
ShareMsFilePrint=0
BindMsNetClient=0
SharedPhoneNumbers=1
GlobalDeviceSettings=0
PrerequisiteEntry=
PrerequisitePbk=
PreferredPort=COM1
PreferredDevice=My Test Modem
PreferredBps=0
PreferredHwFlow=0
PreferredProtocol=0
PreferredCompression=0
PreferredSpeaker=0
PreferredMdmProtocol=0
PreviewUserPw=0
PreviewDomain=0
PreviewPhoneNumber=0
ShowDialingProgress=0
ShowMonitorIconInTaskBar=1
CustomAuthKey=-1
AuthRestrictions=808
TypicalAuth=1
IpPrioritizeRemote=0
IpInterfaceMetric=0
fCachedDnsSuffix=0
IpHeaderCompression=0
IpAddress=0.0.0.0
IpDnsAddress=0.0.0.0
IpDns2Address=0.0.0.0
IpWinsAddress=0.0.0.0
IpWins2Address=0.0.0.0
IpAssign=1
IpNameAssign=1
IpDnsFlags=0
IpNBTFlags=1
TcpWindowSize=0
UseFlags=0
IpSecFlags=0
IpDnsSuffix=
IpCachedDnsSuffix=
Ipv6PrioritizeRemote=0
Ipv6InterfaceMetric=0
Ipv6NameAssign=1
Ipv6DnsAddress=::
Ipv6Dns2Address=::
Ipv6InterfaceId=0000000000000000
NETCOMPONENTS=
ms_msclient=0
ms_server=0
MEDIA=serial
Port=COM1
Device=My Test Modem
ConnectBPS=115200
DEVICE=modem
PhoneNumber=123
AreaCode=
CountryCode=0
CountryID=0
UseDialingRules=0
Comment=
LastSelectedPhone=0
PromoteAlternates=0
TryNextAlternateOnFail=1
HwFlowControl=0
Protocol=0
Compression=0
Speaker=1
MdmProtocol=0