Menu

How to Convert this code to work with Dev Cpp

StephenNY
2010-01-29
2012-09-26
  • StephenNY

    StephenNY - 2010-01-29

    Hi

    I'm trying to get the following code to work with dev c++. I'm using version
    4.9.9.2

    Any thoughts ?

    static void GetMACaddress(void)
    {
      IP_ADAPTER_INFO AdapterInfo[16];       // Allocate information
                                             // for up to 16 NICs
      DWORD dwBufLen = sizeof(AdapterInfo);  // Save memory size of buffer
    
      DWORD dwStatus = GetAdaptersInfo(      // Call GetAdapterInfo
        AdapterInfo,                 // [out] buffer to receive data
        &dwBufLen);                  // [in] size of receive data buffer
      assert(dwStatus == ERROR_SUCCESS);  // Verify return value is
                                          // valid, no buffer overflow
    
      PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to
                                                   // current adapter info
      do {
        PrintMACaddress(pAdapterInfo->Address); // Print MAC address
        pAdapterInfo = pAdapterInfo->Next;    // Progress through
                                              // linked list
      }
      while(pAdapterInfo);                    // Terminate if last adapter
    }
    

    My objective is to get the macaddress or hardware ID so allow me to create
    some sort of passcode requirement for this software. Any help would be greatly
    appreciated.

    If there is some other well established free method of doing this , I would be
    pleased to hear.

     
  • cpns

    cpns - 2010-01-29

    Giver us a clue! In what way does it not work? Fail to compile? Fail to run as
    you expect? What did you expect? Post the compile log text (all of it).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.