We help IT Professionals succeed at work.

Windows file access

psycho_cat_69
on
I need to find a way to put restrictions on some files via Delphi a runtime!  If someone try to change the name of a file on the C drive, i want to be able to validate the access (homemade database) of the user and prevent the user to do this action if he don't have permission!

Code example if it's possible!

Thanx!
Comment
Watch Question

Commented:
You have 3 possibilities:

(1) Use winNT/2k or XP professional. There this functionality is built in.
(2) Write drivers for win9x (not really possible in Delphi).
(3) Hook all file APIs systemwide. That's *very* difficult to do, but possible. This solution will work for most 32bit processes. But file accesses of a 16bit process will not get cought. I guess that is not good enough?

Regards, Madshi.

Commented:
I think that this question is for about 5 000 points at least. :-)

Ivan

Author

Commented:
IPCH:

sorry!  Cannot give more than 300 points!  I would have give like 2500 points if it was possible... but i'm not registered as a member right now! So the system limit me at 300!

Madshi:

With the API call of FindFirstChangeNotification, FindNextChangeNotification, WaitForSingleObject, it's quite easy to know if a file or any file on the drive has been changed.  But the tricky part is that i want to put some restrictions on the files.  No rename, no delete, No copy, etc...  i don't know how to access those properties!

Hope it's a little more clear!

Thanx to both of you!
Commented:
psychoCat, what you want to do was clear from the beginning. My previous comment still stands as it is. You have those 3 possibilities, no more.

300 points is (sadly) the maximum point number for an EE question. What Ivan probably wanted to express is, that your question is damn difficult...   :-)

Regards, Madshi.
psycho_cat_69:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
CERTIFIED EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept Madshi's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.