I am
having an issure with NT 4.0 SP6a where I am receiving an access denied from a
call to CreateFile. This same code works fine on Win2k and XP.
What I
have is an logging executable that gets started as a service and is the
server. I then have another executable that I run from the command line
and it tries to write log messages to the service. On the call to
CreateFile I am seeing a return of access denied. I have been searching
for an answer but from everything I have found it looks like the CreateNamedPipe
and CreateFile calls are setup the same for NT as 2k and XP.
Does
anyone know of why this would work on 2K and XP but not NT?
Here are
how I am calling the two functions. One in the server and the other in the
client.
SERVER:
uiAccess =
(FILE_FLAG_OVERLAPPED |
PIPE_ACCESS_INBOUND);
dwMode =
(PIPE_TYPE_MESSAGE |
PIPE_READMODE_MESSAGE);
dwMode |=
PIPE_WAIT;
hPipe =
CreateNamedPipe(pPipeName,
uiAccess,
dwMode,
1,
uiBufSize,
uiBufSize,
NMPWAIT_USE_DEFAULT_WAIT,
NULL);
CLIENT:
hPipe->hPipe =
CreateFile((const char
*)hPipe->pName,
GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
SECURITY_SQOS_PRESENT |
SECURITY_IDENTIFICATION,
NULL);
Thanks,
Bob
Bader