This is my first post to the exchange.
I managed to create a DLL that hooks to keyboard and mouse events.
It runs fine with normal applications, but when I try to use it from a windows service (TService), I get an access violation error.
The code that does not work is:
hObjHandle := CreateFileMapping ($FFFFFFFF, nil, PAGE_READWRITE, 0,
GetLastError returns 5 (Access denied)
I searched the web and it seems that there is a windows security related issue. I think the problem lies in the second parameter, but do not know what should I replace the nil with.
It seems for now that I found a workaround: by using journalrecord (WH_JOURNALRECORD) within the service instead of using a DLL,
but still, would like to know about the security attributes in delphi.
Can some body help please?