CreateFile in service fails with "access denied"

CreateFile in service fails with "access denied"

Post by uli » Fri, 23 Aug 2002 00:04:47

The following command suceeds in a normal environment, but not in my
service. I tried to let the service run as administrator, localsystem and
the currently logged on user with same outcome.I: is a SCSI cdrom...I tried
CDROM0 as well. The service was created with SERVICE_ALL_ACCESS.

HANDLE hDevice = CreateFile("\\\\.\\i:", GENERIC_READ,
                    NULL,             // default security attributes
                    OPEN_EXISTING,    // disposition
                    0,                // file attributes
                    NULL);            // do not copy file attributes

Thanks for any kind of help.


1. "Access denied" for "My Documents" folder

Please help somebody!
When I click on the My Documents icon on the desktop, it opens, but it says
"access denied" when I try to open anything else that is in that folder.
They all say they are empty, but yet I can't delete them either.  It does
say when I try to delete the supposedly empty folders that I
should check to see if files are "write-protected".  How do I do that?

This folder is listed under "owner" in the documents and settings list.
However, I am the "owner"  And under Documents and Settings, I can access
them by exploring the "default user"  (documents and settings\default
user\My Documents)
How can I fix this?  Can I somehow overwrite the "owner" folder?

I hope someone can help me.  This all happened after I did a system recovery
( just added the original programs back rather than re-write
the HD).  I would hate to have to do a full system recovery, but will if I
have to.  I am hoping someone will tell me how fix this another way  (like
under regedit or something)

Thanks for any help!


running:  XP home on new computer.

2. MMX Audio

3. "access denied" to folders created prior to harddrive put in "slave" position

4. Q: Win 3.X Changing Registered Username

5. Failing HD & "access denied" files

6. OE6 Rich text font

7. Installing USB hub fails - "access denied" - mondll.dll?

8. save as *.gif in Windows Paintbrush

9. Failed to Connect to <local computer> because "WMI: Access denied"

10. The Open Procedure for service "Tcpip" in DLL "Perfctrs.dll" failed

11. Service Pack 1 "Access Denied"

12. Help required: RAS Connection Service "access denied"

13. Services "Access denied"