Jump to content
Ian Branch

Indy10 rev 3627 into D10.3.3?

Recommended Posts

Hi Team,

I have just done a full svn of Indy10 rev 3627.

As there is no Indy260.groupproj I used the the Indy250.groupproj.

IndySystem250.bpl build fails with the following messages...

 

"Building IndySystem250.dproj (Debug, Win32)
[dcc32 Warning] IdGlobal.pas(9537): W1002 Symbol 'RegisterExpectedMemoryLeak' is specific to a platform
[dcc32 Error] IdStackWindows.pas(1455): E2003 Undeclared identifier: 'IfIndex'
[dcc32 Error] IdStackWindows.pas(1601): E2003 Undeclared identifier: 'AdapterIndex'
[dcc32 Fatal Error] IdStack.pas(2394): F2063 Could not compile used unit 'IdStackWindows.pas'"

 

Is this an error/bug or have I missed something?

The other 4 projects in the package build OK.

 

Regards & TIA,

Ian

 

 

Share this post


Link to post
41 minutes ago, Ian Branch said:

I have just done a full svn of Indy10 rev 3627.

Indy does not use SVN anymore.  The latest code is now on GitHub.

Quote

As there is no Indy260.groupproj I used the the Indy250.groupproj.

That should be fine, though the resulting BPLs won't be named consistently with other packages installed in 10.3.  I just haven't gotten around to making and posting project files for 260 yet.  In part because I don't have 10.3 installed!

Quote

[dcc32 Warning] IdGlobal.pas(9537): W1002 Symbol 'RegisterExpectedMemoryLeak' is specific to a platform

Hmm, interesting.  I was not aware of that.  I'll have to consider disabling that warning.

Quote

[dcc32 Error] IdStackWindows.pas(1455): E2003 Undeclared identifier: 'IfIndex'

IfIndex is used when Indy calls GetAdaptersAddresses(), and the IP_ADAPTER_ADDRESSES record has an IfIndex field defined, so not sure why that error would be happening.

Quote

[dcc32 Error] IdStackWindows.pas(1601): E2003 Undeclared identifier: 'AdapterIndex'

AdapterIndex is used when Indy calls GetAdaptersInfo(), but the IP_ADAPTER_INFO record does not have an AdapterIndex field defined.  Not sure where I got that idea from when I wrote that code.  I have fixed that now.

Edited by Remy Lebeau

Share this post


Link to post
24 minutes ago, Remy Lebeau said:

Indy does not use SVN anymore.  The latest code is now on GitHub.

Terminology - svn co https://github.com/IndySockets/Indy/trunk Indy10

25 minutes ago, Remy Lebeau said:

That should be fine, though the resulting BPLs won't be named consistently with other packages installed in 10.3.  I just haven't gotten around to making and posting project files for 260 yet.  In part because I don't have 10.3 installed!

OK.

26 minutes ago, Remy Lebeau said:

Hmm, interesting.  I was not aware of that.  I'll have to consider disabling that warning.

OK.  I will ignore it.

 

26 minutes ago, Remy Lebeau said:

IfIndex is used when Indy calls GetAdaptersAddresses(), and the IP_ADAPTER_ADDRESSES record has an IfIndex field defined, so not sure why that error would be happening.

Will leave that one with you.

 

27 minutes ago, Remy Lebeau said:

AdapterIndex is used when Indy calls GetAdaptersInfo(), but the IP_ADAPTER_INFO record does not have an AdapterIndex field defined.  Not sure where I got that idea from when I wrote that code.  I have fixed that now.

Tks.  I will svn the code again.

 

Tks Remy,

Ian

Share this post


Link to post
23 hours ago, Ian Branch said:

Terminology - svn co https://github.com/IndySockets/Indy/trunk Indy10

There is no /trunk folder in GitHub.

Quote

I've gone back to a previous revision for now.

Did you even try the fix I posted last night for you?  The AdapterIndex error should be fixed now.

 

Regarding the IfIndex error, Indy manually defines the IP_ADAPTER_ADDRESSES record only when HAS_UNIT_IpTypes is not defined.  HAS_UNIT_IpTypes is defined for XE2+, and 10.3 is later than XE2, which means Indy is going to use an external (hopefully Delphi's!) definition of IP_ADAPTER_ADDRESSES rather than Indy's definition.  It would stand to reason that the external definition lacks the IfIndex field (why, I don't know), otherwise you wouldn't be getting an error on it.  Double-check Delphi's definition in the RTL's Winapi.IpTypes.pas unit is accurate, and also make sure you are not falling into this trap.  In the meantime, a simple workaround would be to just comment out the {$DEFINE HAS_UNIT_IpTypes} statement in IdStackWindows.pas for now.

Edited by Remy Lebeau

Share this post


Link to post

Hi Remy,

2 minutes ago, Remy Lebeau said:

There is no /trunk folder in GitHub.

What can I say?  It works.  I am open to an alternative download string to "svn co https://github.com/IndySockets/Indy/trunk Indy10".

2 minutes ago, Remy Lebeau said:

Did you even try the fix I posted last night for you?  The AdapterIndex error should be fixed now.

Yes, per my earlier I svn downloaded rev 3628.

Yes the AdapterIndex error is no more.

3 minutes ago, Remy Lebeau said:

So, a simple workaround would be to just comment out the {$DEFINE HAS_UNIT_IpTypes} statement in IdStackWindows.pas for now.

Tks.  I will give it a try and advise.

Regards,

Ian

Share this post


Link to post
14 minutes ago, Ian Branch said:

What can I say?  It works.  I am open to an alternative download string to "svn co https://github.com/IndySockets/Indy/trunk Indy10".

See Support for Subversion clients in GitHub's documentation.

Quote

Yes, per my earlier I svn downloaded rev 3628.

Now that Indy is on GitHub, SVN revision numbers don't really have any meaning to Indy anymore.  There is no readily available mapping of GitHub's SVN revision numbers to GIT commits within the GIT system, so when you say "svn rev XYZ", I don't know which GIT commit that actually refers to, unless I go access the system via SVN and look at the metadata.  Just saying...

 

 

 

Edited by Remy Lebeau

Share this post


Link to post

Hi Remy,

Tried your suggestion for the IfIndex error.  Still get it. 😞

I even deleted the Define line, just to be sure.

Is it possible that any other 3rd Party I have installed is causing the issue?

Regards,

Ian

Share this post


Link to post
9 minutes ago, Ian Branch said:

Tried your suggestion for the IfIndex error.  Still get it. 😞

But, did you validate whether Delphi's definition of IP_ADAPTER_ADDRESSES has IfIndex or not?  I don't have access to the RTL's IpTypes.pas source file right now to look myself, I'll do that tomorrow.

9 minutes ago, Ian Branch said:

Is it possible that any other 3rd Party I have installed is causing the issue? 

Indy should not be accessing any 3rd party IpTypes unit.  But, that is why I did say to make sure that is not happening (did you read that link yet?):

Quote

Changing IPtypes to winapi.IPtypes fixed the problem

If HAS_UNIT_IpTypes is defined, then try making that same change to IdStackWindows.pas.  But, if HAS_UNIT_IpTypes is not defined, then that doesn't matter, and you should not be getting the error since Indy does define the IfIndex field in its own definition of the IP_ADAPTER_ADDRESSES record:

IP_ADAPTER_ADDRESSES = record
    Union: record
      case Integer of
        0: (
          Alignment: ULONGLONG);
        1: (
          Length: ULONG;
          IfIndex: DWORD); // <-- HERE!!!!!
    end;
    Next: PIP_ADAPTER_ADDRESSES;
    AdapterName: PIdAnsiChar;
    FirstUnicastAddress: PIP_ADAPTER_UNICAST_ADDRESS;
    FirstAnycastAddress: PIP_ADAPTER_ANYCAST_ADDRESS;
    FirstMulticastAddress: PIP_ADAPTER_MULTICAST_ADDRESS;
    FirstDnsServerAddress: PIP_ADAPTER_DNS_SERVER_ADDRESS;
    DnsSuffix: PWCHAR;
    Description: PWCHAR;
    FriendlyName: PWCHAR;
    PhysicalAddress: array [0..MAX_ADAPTER_ADDRESS_LENGTH - 1] of BYTE;
    PhysicalAddressLength: DWORD;
    Flags: DWORD;
    Mtu: DWORD;
    IfType: IFTYPE;
    OperStatus: IF_OPER_STATUS;
    Ipv6IfIndex: IF_INDEX;
    ZoneIndices: array [0..15] of DWORD;
    FirstPrefix: PIP_ADAPTER_PREFIX;
    TransmitLinkSpeed: ULONG64;
    ReceiveLinkSpeed: ULONG64;
    FirstWinsServerAddress: PIP_ADAPTER_WINS_SERVER_ADDRESS_LH;
    FirstGatewayAddress: PIP_ADAPTER_GATEWAY_ADDRESS_LH;
    Ipv4Metric: ULONG;
    Ipv6Metric: ULONG;
    Luid: IF_LUID;
    Dhcpv4Server: SOCKET_ADDRESS;
    CompartmentId: NET_IF_COMPARTMENT_ID;
    NetworkGuid: NET_IF_NETWORK_GUID;
    ConnectionType: NET_IF_CONNECTION_TYPE;
    TunnelType: TUNNEL_TYPE;
    //
    // DHCP v6 Info.
    //
    Dhcpv6Server: SOCKET_ADDRESS;
    Dhcpv6ClientDuid: array [0..MAX_DHCPV6_DUID_LENGTH - 1] of Byte;
    Dhcpv6ClientDuidLength: ULONG;
    Dhcpv6Iaid: ULONG;
    FirstDnsSuffix: PIP_ADAPTER_DNS_SUFFIX;
  end;

 

Edited by Remy Lebeau

Share this post


Link to post
2 minutes ago, Remy Lebeau said:

But, did you validate whether Delphi's definition of IP_ADAPTER_ADDRESSES has IfIndex or not?  I don't have access to IpTypes.pas right now to look myself.

Pardon my ignorance but I am unsure how to do that.

 

3 minutes ago, Remy Lebeau said:

Indy should not be accessing any 3rd party IpTypes unit.  But, that is why I did say to make sure that is not happening (did you read that link yet?).

I looked at it but didn't understand it. 😞

Share this post


Link to post
1 minute ago, Ian Branch said:

Pardon my ignorance but I am unsure how to do that.

 

I looked at it but didn't understand it. 😞

Refresh and look at my updated previous reply

Share this post


Link to post

Hi Remy,

Apologies for being a PITA.

My winapi.IPtypes has the following..

  PIP_ADAPTER_ADDRESSES = ^_IP_ADAPTER_ADDRESSES;
  {$EXTERNALSYM PIP_ADAPTER_ADDRESSES}
  _IP_ADAPTER_ADDRESSES = record
    Union: record
      case Integer of
        0: (
          Alignment: ULONGLONG);
        1: (
          Length: ULONG;
          IfIndex: DWORD);
    end;
    Next: PIP_ADAPTER_ADDRESSES;

Ian

Share this post


Link to post

P.S.  I changed the uses ...., IpTypes to ...., WinApi.IpTypes, in IdStackWindows but no change.

Share this post


Link to post

Hi Remy,

To make 100% sure we are dealing with the same code base I just did per the GitHib instructions for svn you directed me to.

"svn co https://github.com/IndySockets/Indy.git Indy10New"

It gave me 'Branches' and 'Trunk' sub directories and within Trunk were all the usual folders/files. 🙂

Retried Indy250.groupproj.  - Same result. 😞

 

Ian

Share this post


Link to post
24 minutes ago, Ian Branch said:

My winapi.IPtypes has the following..

That clearly shows that the IfIndex field is present in Delphi's definition of IP_ADAPTER_ADDRESSES, as it should be.

22 minutes ago, Ian Branch said:

P.S.  I changed the uses ...., IpTypes to ...., WinApi.IpTypes, in IdStackWindows but no change.

I don't know what else to tell you then.  If you load up Indy's IndySystem package in the IDE and Ctrl-Click on PIP_ADAPTER_ADDRESSES in the IdStackWindows.pas code, where does it take you?

Edited by Remy Lebeau

Share this post


Link to post

Hi Remy,

I don't know if it has any bearing but I just noticed your..

IP_ADAPTER_ADDRESSES = record

is different to mine..

 

_IP_ADAPTER_ADDRESSES = record

Ian

Share this post


Link to post
4 minutes ago, Ian Branch said:

I don't know if it has any bearing but I just noticed your..


IP_ADAPTER_ADDRESSES = record

is different to mine..

 


_IP_ADAPTER_ADDRESSES = record

It shouldn't matter.  Delphi defines it with a leading underscore, Indy does not.  Delphi should have another statement that maps _IP_ADAPTER_ADDRESSES to IP_ADAPTER_ADDRESSES.

Edited by Remy Lebeau

Share this post


Link to post
2 minutes ago, Remy Lebeau said:

It shouldn't matter.  Delphi defines it with a leading underscore, Indy does not.  Delphi should have another statement that maps _IP_ADAPTER_ADDRESSES to IP_ADAPTER_ADDRESSES.

Yes it does.

Share this post


Link to post

Let's do a quick test: create a new test app, and put something like this in it:

program Test;

{$APPTYPE CONSOLE}  

uses
  Winapi.IpTypes;

var
  A: IP_ADAPTER_ADDRESSES;
begin
  A.IfIndex := 0;
end.

If that compiles, then I'm out of ideas why Indy fails to compile when accessing IfIndex when using the definition of IP_ADAPTER_ADDRESSES from either Winapi.IpTypes or IdStackWindows.

Edited by Remy Lebeau

Share this post


Link to post

Hi Remy,

Nope.  Doesn't compile. Undeclared identifier for IfIndex.

"[dcc32 Error] Project23.dpr(11): E2003 Undeclared identifier: 'IfIndex'"

 

Ian

Screenshot_1.jpg

Share this post


Link to post
42 minutes ago, Ian Branch said:

Nope.  Doesn't compile. Undeclared identifier for IfIndex.

"[dcc32 Error] Project23.dpr(11): E2003 Undeclared identifier: 'IfIndex'"

Nevermind, I'm blind.  I see the issue now.  It needs to be referred to as Union.IfIndex instead:

A.Union.IfIndex := 0;

Now I know what needs to be fixed in Indy, too.  I'll do that tomorrow.

Edited by Remy Lebeau

Share this post


Link to post

Yup.  Well done. 

"TIdStackLocalAddressAccess(LAddress).FInterfaceIndex := Adapter^.Union.IfIndex;"

Fixes it.

 

Regards,

Ian

Share this post


Link to post
17 hours ago, Ian Branch said:

Yup.  Well done. 

"TIdStackLocalAddressAccess(LAddress).FInterfaceIndex := Adapter^.Union.IfIndex;"

Fixes it.

I just now checked in that fix.

Share this post


Link to post

Morning Remy, or Evening, as the case may be.

I did a fresh pull.

I noticed the Indy260.groupproj and tried it but not all of the libraries are  there yet.

I then tried Indy250.groupproj, all there, went to build and got the following messages.

"Building IndySystem250.dproj (Debug, Win32)
[dcc32 Warning] IdGlobal.pas(9537): W1002 Symbol 'RegisterExpectedMemoryLeak' is specific to a platform
[dcc32 Error] IdCTypes.pas(191): E2003 Undeclared identifier: 'size_t'
[dcc32 Fatal Error] IndySystem250.dpk(51): F2063 Could not compile used unit 'IdCTypes.pas'
Failed"

 

The other 4 libraries seem to build OK.

 

Regards,

Ian

Edited by Ian Branch
Update

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×