Discussion:
RasSetEntryProperties() doesn't write to rasphone.pbk if non-admin
(too old to reply)
Whitney Kew
2006-03-07 00:30:27 UTC
Permalink
Hello,

System setup: WinXP SP2, .NET 2003. We have some Managed C++ code that
calls RasSetEntryProperties() to create a phonebook entry in order to perform
a direct connection through a COM port. If I am logged in to the machine as
a Windows administrator, the RasSetEntryProperties() call returns 0, and I
see the file size of rasphone.pbk jump from 0 KB to 2 KB, indicating that a
phonebook entry has been added. However, when I log in as a non-admin (i.e.,
a standard User), my RasSetEntryProperties() call still returns 0, but the
size of rasphone.pbk remains at 0 KB, and I cannot connect to the port. This
happens even when I open up permissions on rasphone.pbk and its parent
directory. Does anyone have any ideas as to what might be going on?
--
Whitney Kew
Software Engineer
Whitney Kew
2006-03-07 18:28:15 UTC
Permalink
Hi Terry,

Thanks very much for responding; your response led me to discover that I was
looking at the wrong rasphone.pbk! I was looking at the one inside the "All
Users" Documents and Settings tree, when I should have been looking at the
one in my non-admin user's Documents and Settings tree. That helps a lot.
However, there is a line in the MS online help for RasSetEntryProperties()
that says: "Note: Specifying a non-NULL value for the lpszPhonebook
parameter may not be supported in versions of Windows later than Windows XP."
According to the online help, your proposed solution #3 below for creating a
new entry in "All Users" might not be supported in future versions of
Windows. Might there be a workaround for that? Thanks!
--
Whitney Kew
Software Engineer
Hi Whitney,
Welcome to MSDN Newsgroup!
Based on my knowledge, if we want to call RasSetEntryProperties API with
1.If you call RasSetEntryProperties to modify an existing phone book entry
that was created only for one particular user then you cannot modify it.
2.You can only modify existing entries if they are created for "All Users"
when using RasSetEntryProperties in Local System account.
3.If you want to create a new entry then you need to pass in the complete
path of the default phone book for "All Users" to the RasSetEntryProperties
"C:\\Documents and Settings\\All Users\\Application
Data\\Microsoft\\Network\\Connections\\Pbk\\Rasphone.pbk " as the first
parameter to the RasSetEntryProperties call.
I hope the above information is helpfulr for you. Thanks for you
understanding!
Best Regards,
Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
--------------------
Thread-Topic: RasSetEntryProperties() doesn't write to rasphone.pbk if
non-admin
thread-index: AcZBflTnITqnJwcQSLmCQDjwyh25TA==
X-WBNR-Posting-Host: 69.63.215.34
Subject: RasSetEntryProperties() doesn't write to rasphone.pbk if non-admin
Date: Mon, 6 Mar 2006 16:30:27 -0800
Lines: 15
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
microsoft.public.win32.programmer.networks,microsoft.public.windowsnt.protoc
ol.ras
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.windowsnt.protocol.ras:46371
microsoft.public.win32.programmer.networks:29128
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.win32.programmer.networks
Hello,
System setup: WinXP SP2, .NET 2003. We have some Managed C++ code that
calls RasSetEntryProperties() to create a phonebook entry in order to
perform
a direct connection through a COM port. If I am logged in to the machine
as
a Windows administrator, the RasSetEntryProperties() call returns 0, and I
see the file size of rasphone.pbk jump from 0 KB to 2 KB, indicating that
a
phonebook entry has been added. However, when I log in as a non-admin
(i.e.,
a standard User), my RasSetEntryProperties() call still returns 0, but the
size of rasphone.pbk remains at 0 KB, and I cannot connect to the port.
This
happens even when I open up permissions on rasphone.pbk and its parent
directory. Does anyone have any ideas as to what might be going on?
--
Whitney Kew
Software Engineer
Loading...