My project is divided into two parts one is client and other is server (which is Language Monitor DLL).
On server side creates NamedPipe using “CreateNamedPipe” and waiting for Client connection using “ConnectNamedPipe” Win32 API’s.
Once the connection is established ReadFile and WriteFile follows.
After three times successfully ReadFile and WriteFile operation server side application terminates when it try to read from Pipe(using ReadFile), with error code 998 which is “Invalid access to memory location.”
I am passing a buffer (which is a structure) to ReadFile, which I have allocated through “new”.
“Spoolsv.exe” calls my Server DLL (which is a Language Monitor DLL) on every system reboot.
If I try to stop “Spoolsv.exe” through Task Manager and again start “Spoolsv.exe” by double clicking, every thing works fine. Problem occurs only when “Spoolsv.exe” calls my dll just after reboot.
If I add
into environment setting then my systems works fine.
I have not installed DDK on my system; I am just adding these two entries.
If I am creating my own heap using “HeapCreate” API function and allocating memory through “HeapAlloc” API then every thing working fine.
Same problem we had faced some time back, that time we were passing static buffer to ReadFile then we changed to dynamic buffer and system started working, if today I pass static buffer then systems work fine.
Development and Test environment:
Visual studio 5.0
Service pack 1.
Could you tell where I would be going wrong?