From: Eric K. <ek...@rz...> - 2002-06-27 15:23:01
|
"Casper Hornstrup" <ch...@us...> wrote: > > No! If the OBJ_OPENLINK attribute is set, a link object will be opened > > instead of the target it points to. So you have to use OBJ_OPENLINK if you > > want to retrieve link's target path, change a link's target path or delete a > > link object but not the object it points to. But if you want to open the > > target of a link OBJ_OPENLINK must not be set. > > And opening the target is intended here? Yes, I want to check whether 'C:\reactos' exists and can be opened. But should > NtOpenSymbolicLinkObject() be used here then? It's name suggest that it > does just that - opens the link object itself and not the target. What > does the NT implementation do? You're right! Using NtOpenFile() instead of NtOpenSymbolicLinkObject() is much more appropriate. I checked NtOpenSymbolicLink() and it doesn't set the OBJ_OPENLINK attribute. But instead IoDeleteSymbolicLink() needs to be changed. It needs to open the specified link using the OBJ_OPENLINK attribute. > Then there is another problem. When trying to open the target object > here, NtOpenSymbolicLinkObject() fails because the file system is not > mounted yet and the file system is not mounted by this request. IIRC it > is only mounted on the first create request. Should the call to > NtOpenSymbolicLinkObject() cause the filesystem to be mounted? The filesystem should be mounted. In case the filesystem cannot be mounted, the system should issue an INACCESSIBLE_BOOT_DEVICE error and stop (BSOD). > I should have said MinGW runtime 2.0 here. Newest w32api is 1.5. Well, runtime 2.0 is still in beta state, isn't it. Does runtime 1.5 work? Eric |