COM APIs problem, Unable to intercept some APIs - Windows CE

This is a discussion on COM APIs problem, Unable to intercept some APIs - Windows CE ; I have some prob. related to COM APIs. when i write data it writes successfully but when i tried to read from the port COM1 it flashes Error 998 which is "Invalid access to memory location." Main function calls which ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: COM APIs problem, Unable to intercept some APIs

  1. COM APIs problem, Unable to intercept some APIs

    I have some prob. related to COM APIs.
    when i write data it writes successfully but when i tried to read from
    the port COM1 it flashes
    Error 998 which is "Invalid access to memory location."

    Main function calls which i used are as:
    m_hCom = CreateFile(_T("COM1"),GENERIC_READ | GENERIC_WRITE, 0, NULL,
    OPEN_EXISTING, 0, 0);

    iWriteRes = WriteFile (m_hCom , pWBuf, nBytesToWrite, &cbWritten,
    NULL);
    iReadRes = ReadFile (m_hCom, pRBuf, nBytesToRead, &cbRead, NULL);

    And also when i try to debug this application through my client-server
    app. then my
    client code intercepts all COM related APIs except the 3 viz.
    WriteFile(Although it shows that write is successful),ReadFile(Fails),
    CloseHandle.

    can anybody tell me whats wrong happening here???


    Thnx and Regards,
    Ansh


  2. Re: COM APIs problem, Unable to intercept some APIs

    >I have some prob. related to COM APIs.
    >when i write data it writes successfully but when i tried to read from
    >the port COM1 it flashes
    >Error 998 which is "Invalid access to memory location."
    >
    >Main function calls which i used are as:
    >m_hCom = CreateFile(_T("COM1"),GENERIC_READ | GENERIC_WRITE, 0, NULL,
    > OPEN_EXISTING, 0, 0);
    >
    >iWriteRes = WriteFile (m_hCom , pWBuf, nBytesToWrite, &cbWritten,
    >NULL);
    >iReadRes = ReadFile (m_hCom, pRBuf, nBytesToRead, &cbRead, NULL);


    What does pRBuf point to, and what is the value of nBytesToRead?

    Dave

+ Reply to Thread