Re: RasSetEntryProperties sample

Tech-Archive recommends: Fix windows errors by optimizing your registry



I'm passing RasEntry as an array of bytes and using the field offsets to fill the values. The part of sample RasEntry and declaration for RasSetEntryProperties. This method works well for CF1.0+.

public class RASENTRY
{
public RASENTRY()
{
this.data = new byte[3276];
this.dwSize = 3276;
}

public byte[] Data
{
get
{
return this.data;
}
}

public int dwSize
{
get
{
return BitConverter.ToInt32(this.data, 0);
}
set
{
BitConverter.GetBytes(value).CopyTo(this.data, 0);
}
}

...

private byte[] data;
private const int dwCountryCodeOff = 12;
private const int dwCountryIDOff = 8;
private const int dwOptionsOff = 4;
private const int dwSizeOff = 0;
}



[DllImport("coredll")]
internal static extern int RasSetEntryProperties(string lpszPhoneBook, string szEntry, byte[] lpbEntry, int dwEntrySize, byte[] lpb, int dwSize);

HTH,
S.


--
Sergey Bogdanov
http://www.binitex.com


Catalin Lungu wrote:
Hi all,
Someone has a sample application that how to use RasSetEntryProperties function in C#, with RasEntry struct?

Ceers,
Catalin


.



Relevant Pages

  • RasSetEntryProperties configuration question
    ... device using the api function RasSetEntryProperties and the RASENTRY ... This lead me to look at the device specific configuration that you can ... format as that produced by lineConfigDialogEdit - but I can't find any ...
    (microsoft.public.windowsce.platbuilder)
  • Re: ras error 603!
    ... Check that the "dwEntrySize" parameter passed to RasSetEntryProperties is ... been initialized to the sizeof a RASENTRY. ...
    (microsoft.public.pocketpc.developer.networking)