Maxim
Wed Feb 16 12:32:26 CST 2005
So, save the filename string together with the open handle, and write your own
ReOpenFile with this structure. Very easy. Much easy then rewriting all FSDs
for MS's developers :)
Another way. Open with maximum access, then DuplicateHandle to small access,
and only use the duplicated handle in most work for minimal privileges.
> Your observation, while technically correct, assumes that MS is incapable of
> performing access checks when additional access rights are required.
Exactly.
All access checks are gathered to a point just before the access is granted.
> limitation does not become a feature simply by changing its label. Perhaps
> granting additional access rights fits better into the logic of ReOpenFile.
Such logic must be supported in all FSDs at least :-) writing 1 more code path
to any FSD just to satisfy the need of 0.001% of developers is really clumsy :)
> In any event, a PERFORM_ACCESS_CHECKS flag for DuplicateHandle would be
> extremely useful in a future release.
It will not be there. The FSDs do not support it. More so - I think no OS
supports this :)
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com