Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

alejandrofuchs

@alejandrofuchs
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • T-SQL: null != value evaluates false [modified]
    A alejandrofuchs

    Null = Value does not evaluate to false, nor true. It's Unknown. So there are not only two values: True and False, but also Unknown From MSDN: A value of NULL indicates that the value is unknown. A value of NULL is different from an empty or zero value. No two null values are equal. Comparisons between two null values, or between a NULL and any other value, return unknown because the value of each NULL is unknown.

    Clever Code database php com tools question

  • Can not take my own IP address (Windows Server 2003)
    A alejandrofuchs

    Yes, this works. I will change my code. I still have the doubt about why it doesn't work only on Windows 2003, but as this code works fine i prefer this new aproach. :)Thank you to you all for your help! PD. Only for curiosity :confused:, if somebody find out what's wrong on the original code under 2003, please write. :)alejandrofuchs@yahoo.com

    C / C++ / MFC sysadmin windows-admin question

  • Can not take my own IP address (Windows Server 2003)
    A alejandrofuchs

    Thanks! First, i'm sorry, someone else (joseaxy) was already signed in codeproject in this machine, so my later response had that name. Second (again i'm sorry), i responded wrong, the rigth answer is: WSAGetLastError() returns 10110, WSALookupServiceNext is returning 0 the second time it is called. alejandrofuchs@yahoo.com

    C / C++ / MFC sysadmin windows-admin question

  • Can not take my own IP address (Windows Server 2003)
    A alejandrofuchs

    Hi, I cann't take my own IP address on Windows Server 2003. This is the code i'm using, it works fine in Windows 2000 (Professional and Server) and Windows XP, but DOESN'T WORK IN Windows Server 2003. I'm getting crazy, Why it doesn't work only in Windows 2003?

    int iSockErr = 0;
    HANDLE hnd = 0;
    WORD wVersionRequested = MAKEWORD(2, 2);
    WSADATA wsaData;
    try
    {
    
        //Inicializar los sockets
        if ((iSockErr = WSAStartup(wVersionRequested, &wsaData)) != 0) { throw 1; }
    
        DWORD dw;
        GUID guid = SVCID\_HOSTNAME;
        struct AUX{
            WSAQUERYSET qsRestrictions;
            BYTE byte\[500\];
        }aux;
    
        memset(&aux.qsRestrictions, 0, sizeof(WSAQUERYSET));
        aux.qsRestrictions.dwSize = sizeof(WSAQUERYSET);
        aux.qsRestrictions.lpServiceClassId = &guid;
        if (WSALookupServiceBegin(&aux.qsRestrictions, LUP\_RETURN\_ADDR, &hnd)) { throw 2; }
    
        dw = sizeof(aux);
        memset(&aux, 0, sizeof(aux));
        aux.qsRestrictions.dwSize = sizeof(WSAQUERYSET);
        while ( !WSALookupServiceNext(hnd, LUP\_RETURN\_ADDR, &dw, &aux.qsRestrictions) )
        {
    

    //IN WINDOWS 2003 aux.qsRestrictions.lpcsaBuffer IS ALWAYS NULL

            ptyIP->d0 = aux.qsRestrictions.lpcsaBuffer\[0\].RemoteAddr.lpSockaddr->sa\_data\[2\];
            ptyIP->d1 = aux.qsRestrictions.lpcsaBuffer\[0\].RemoteAddr.lpSockaddr->sa\_data\[3\];
            ptyIP->d2 = aux.qsRestrictions.lpcsaBuffer\[0\].RemoteAddr.lpSockaddr->sa\_data\[4\];
            ptyIP->d3 = aux.qsRestrictions.lpcsaBuffer\[0\].RemoteAddr.lpSockaddr->sa\_data\[5\];
        }
    
        ...
    

    Thank you very much.

    C / C++ / MFC sysadmin windows-admin question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups