Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot access memory of Ip address from gethostname
    primarykey
    data
    text
    <p>I'm developing an after effects plugin and I'm trying to integrate raknet which is a c++ network library. When the raknet library is trying to get the ipv4 address by calling</p> <pre><code>gethostbyname </code></pre> <p>it then throws an error access violation reading location 0xFFFFFFFFFFFFFFFF</p> <pre><code>int idx=0; char ac[ 80 ]; int err = gethostname( ac, sizeof( ac ) ); (void) err; RakAssert(err != -1); struct hostent *phe = gethostbyname( ac ); if ( phe == 0 ) { RakAssert(phe!=0); return ; } for ( idx = 0; idx &lt; MAXIMUM_NUMBER_OF_INTERNAL_IDS; ++idx ) { if (phe-&gt;h_addr_list[ idx ] == 0) break; memcpy(&amp;addresses[idx].address.addr4.sin_addr,phe-&gt;h_addr_list[ idx ], sizeof(struct in_addr)); } while (idx &lt; MAXIMUM_NUMBER_OF_INTERNAL_IDS) { addresses[idx]=UNASSIGNED_SYSTEM_ADDRESS; idx++; } </code></pre> <p>Here are some pictures of what I see.</p> <p><a href="http://jacobsgriffith.com/stackoverflow/noaccesserror.png" rel="nofollow noreferrer">http://jacobsgriffith.com/stackoverflow/noaccesserror.png</a></p> <p>I've read this and it doesn't look like the library implemented it wrong. <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms738524%28v=vs.85%29.aspx" rel="nofollow noreferrer">Microsoft Documentation On gethostbyname</a></p> <p>When I hover over h_addr_list and h_aliases I get .</p> <p><a href="http://jacobsgriffith.com/stackoverflow/noaccess.jpg" rel="nofollow noreferrer">http://jacobsgriffith.com/stackoverflow/noaccess.jpg</a></p> <p>Anybody have any ideas? Why is this failing I'm pretty sure this is a common function.</p> <p>Another thing, is there any difference between the implementations of the gethostbyname function from winsock and winsock2?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload