On Fri, 10 Apr 2009 01:57:16 +0400, Stewart Gordon <[email protected]> wrote:

Leonid Krashenko wrote:
<snip>
    RASENTRYNAME[100] buf;
    buf.ptr.dwSize = RASENTRYNAME.sizeof;
    uint entriesNum, length = buf.length*RASENTRYNAME.sizeof;

What value are you actually getting for RASENTRYNAME.sizeof?

And does buf.sizeof give the same value as buf.length*RASENTRYNAME.sizeof, as it should?

Yes, it does;
RASENTRYNAME size = 532
WINVER = 0x501 (-version=WindowsXP)

<snip>
BUT the analogous DELPHI code works perfectly:
Code:
procedure getPhoneBookEntries(list: TStrings);
var
  BuffSize          : Integer;
  Entries           : Integer;
  Entry             : Array[1..MaxEntries] of TRasEntryName;
  X,Result_         : Integer;
begin
  list.Clear;
  Entry[1].dwSize:=SizeOf(TRasEntryName);
  BuffSize:=SizeOf(TRasEntryName)*MaxEntries;
<snip>

Again, what values are you getting?

Delphi:
SizeOf(TRasEntryName) = 264
bufsize = 26400

MinGW C++ variant of this program has WINVER = 0x400, entry size = 264 (works fine too).


Stewart.

Reply via email to