Overlapped problem with CreateNamedPipe in NT Service

Discussion in 'C++' started by Lewap, Jan 10, 2005.

  1. Lewap

    Lewap Guest

    Hi!

    I have a problem:
    Function CreateNamedPipe (a piece of source below) called in a NT service I
    get an error 997 - Overlapped I/O operation is in progress.

    When I run the same code as oridinal application (not NT service) everything
    works properly.

    Service is develop in Managed/Unmanaged C++ (.NET Environment). And is
    runing on LocalSystem account so I think it is not problem with privileges

    <code>
    LPTSTR lpszPipename = (LPTSTR) \\\\.\\pipe\\testpipe;

    hPipe = CreateNamedPipe(

    lpszPipename, // pipe name

    PIPE_ACCESS_DUPLEX | // read/write access

    FILE_FLAG_OVERLAPPED,

    PIPE_TYPE_MESSAGE | // message type pipe

    PIPE_READMODE_MESSAGE | // message-read mode

    PIPE_WAIT, // blocking mode

    1, // number of instances (max. instances - PIPE_UNLIMITED_INSTANCES)

    BUFSIZE, // output buffer size

    BUFSIZE, // input buffer size

    PIPE_TIMEOUT, // client time-out

    NULL);

    if (hPipe == INVALID_HANDLE_VALUE) {

    log->WriteEntry("Error creating pipe!", EventLogEntryType::Error);

    err = __box(GetLastError());

    logEntry = String::Format("Last error: {0}", err);

    log->WriteEntry(logEntry);

    }

    else {

    log->WriteEntry("Success creating pipe!");

    }

    CloseHandle(hPipe);

    <code>

    Thanks in advance for any help or suggestions

    Best regards
    Pawel.
     
    Lewap, Jan 10, 2005
    #1
    1. Advertising

  2. Lewap

    red floyd Guest

    Lewap wrote:
    > [redacted]
    > Thanks in advance for any help or suggestions


    My suggestion is that you check a newsgroup with "microsoft" or "ms" in
    its name.
     
    red floyd, Jan 10, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yamadora1999
    Replies:
    0
    Views:
    330
    yamadora1999
    Jul 21, 2004
  2. BMW
    Replies:
    3
    Views:
    2,719
    BB206
    Oct 16, 2007
  3. BMW
    Replies:
    0
    Views:
    118
  4. Michelle Kinsey-Clinton
    Replies:
    5
    Views:
    409
    Bob Barrows
    Aug 11, 2003
  5. AmyAdmin
    Replies:
    3
    Views:
    444
    Bob Barrows [MVP]
    Dec 3, 2004
Loading...

Share This Page