>Hi George,
>
>I known "RunAs", but i use Kerberos for access to SQL Server,
>then the process where the ODBC run must to have the user Rights.
>
>Yes, i can split the process into two piece , but this me seems excessive,
>and this not solve the issue:
>
I want to be guaranteed that during the life of the process,
> no other can put the hands within to the folder.>
>This does not have to that to make with Application's Rights are granted,
>probably WinFX does not implement this concept.
>
>My demand is a lot, the much simplest one.
>
>One API:
>
>BOOL LockDirectory( LPCTSTR lpPathName, BOOL bLock);
>
>
>Are we still to the age of the stone in the OS ?
>
>I hope that WinFX implement this, but I have many doubts.
>
Fabio,
Have you looked at the LockFile() API function? It might be able to do what you're looking for. While you're trying to lock a directory, since it's nothing more than a file containing files and most of the other functions based on files (such as MoveFile()) work with directories as well, it might work.
George
Ubi caritas et amor, deus ibi est