Copy one byte in a certain char char mass index



  • With memcpy, we need to collate the 0x00 Byte into a certain index of the WSABUF structure (Winsock) lpBuffers-nationalbuf.

    введите сюда описание изображения

    int WSAAPI WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
    

    typedef struct _WSABUF {
    ULONG len; /* the length of the buffer */
    CHAR FAR buf; / the pointer to the buffer */
    } WSABUF, FAR * LPWSABUF;

    In the lpBuffers-statebuf, the indicator on the char's mass, where you need to change one bete with memcpy



  • Um... You. lpBuffers - indicator of structure WSABUFin each of which there is a field-indicator on the mass charHuh. Accordingly, the next line will be 0 i- mass buf Total 0- structure WSABUF mass lpBuffers:

    lpBuffers->buf[i] = 0;
    

    It's equivalent to the following line:

    lpBuffers[0].buf[i] = 0;
    

    For compulsion i- of the mass buf j- structure WSABUF mass lpBuffersI need to write down:

    lpBuffers[j].buf[i] = 0;
    

    Of course, we believe that all the indexes buf Initiated and what j<dwBufferCount and i<len

    I don't know what you're specifically looking for, my answer corresponds to the completeness of your question, and I hope it' be helpful to you.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2