Re: Dns.GetHostEntry throws SocketException in WM2005, OK in PPC2003

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



GetHostEntry(String) works where String = "MyPPC" (for example), but not
"dtpt_peer"

"Scott" <Spam@xxxxxxxxxxxx> wrote in message
news:eWcq5p%23IHHA.3668@xxxxxxxxxxxxxxxxxxxxxxx
Using C#, .Net CF 2.0, WM 2005 on Symbol MC9090

IPHostEntry Dns.GetHostEntry (String)
Throws:-
{System.Net.Sockets.SocketException: The system detected an invalid
pointer address in attempting to use a pointer argument in a call
at System.Net.Dns.ResolveInternal()
at System.Net.Dns.GetHostEntry()

The SocketException contains an ErrorCode (0x0000271e) that equates to the
following socket error:-
The system detected an invalid pointer address in attempting to use a
pointer argument of a call. This error occurs if an application passes an
invalid pointer value, or if the length of the buffer is too small. For
instance, if the length of an argument, which is a sockaddr structure, is
smaller than the sizeof(sockaddr).

The same call works on PPC 2003.

Can anyone shed any light on this?




.



Relevant Pages

  • Re: null references
    ... To say that null and invalid references don't exist suggests that if you would just change to the function would be unable to fail and therefore correctly manages the semaphore, but this is a bogus argument. ... The reference version of the function can still throw an access violation and still needs to be coded for exception safety. ... If you define the above function as taking a reference arg then the undefined behaviour occurs the moment someone tries to dereference an invalid pointer. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: access_ok macor
    ... The problem which I have is that if I run socketpair, getsockname, getpeername LTP ... tests with invalid salen pointer there are addresses close to 0x0. ... This sounds like a classic NULL pointer dereference that is handled correctly ... err = get_user; ...
    (Linux-Kernel)
  • Re: interpreting a null pointer as an empty (null string)
    ... there requires doing something that has undefined behavior (or, at least, ... which is the usual destination of the null pointer. ... Looks like this is explicitly disallowed by the Standard, ... null pointers being "invalid" as operands of the indirection operator; ...
    (comp.lang.c)
  • Re: null references
    ... invalid to cause an access violation, ... The reference version of the function can still throw an access ... obtained by dereferencing a null pointer which causes undefined behaviour". ... occurs before the function has even started so how can it protect itself. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Reading from invalid memory
    ... from the same invalid memory location I do not get any errors. ... since constructing or dereferencing an invalid pointer ... Undefined behavior can be anything, ...
    (comp.unix.programmer)