Implement directory object in wineserver.
Robert Shearman
rob at codeweavers.com
Wed Nov 23 12:59:24 CST 2005
Vitaliy Margolen wrote:
>Wednesday, November 23, 2005, 11:05:05 AM, Robert Shearman wrote:
>
>
>>Alexandre Julliard wrote:
>>
>>
>
>
>
>>>Vitaliy Margolen <wine-devel at kievinfo.com> writes:
>>>
>>>+/* open a new handle to an existing object */
>>>+obj_handle_t open_object_dir( const struct object_attr *attr, const struct object_ops *ops,
>>>+ unsigned int access )
>>>
>>>
>
>
>
>>If so, I don't see much of a problem with it. Maybe we shouldn't return
>>a handle, but instead return a "struct object *" or a "void *", but
>>passing in struct object_ops * into the function isn't doing anything
>>other than eliminating common code in most of the objects. It doesn't
>>force anything to be exported outside of the implementation of the object.
>>
>>
>
>The part I'm talking about is this:
>Using object_attr:
>static struct object *create_mapping( const struct object_attr *attr, file_pos_t size, int protect,
> obj_handle_t handle )
>
>No using object_attr:
>static struct object *create_mapping( const struct object *root, const struct unicode_str *name,
> unsigned int attr, file_pos_t size, int protect,
> obj_handle_t handle )
>
>And this:
>struct object_attr
>{
> obj_handle_t rootdir; /* RootDirectory */
> struct unicode_str *name; /* ObjectName */
> unsigned int attributes; /* Attributes */
>};
>
>I can replace handle with object * but that will just add more code to
>each
>[open|close]_[even|mapping|semaphore|timer|namedpipe|winstation|desktop]
>
>
That obviously should be a "struct directory *" (note: not const since
you will be inserting it into the directory) if it isn't an
obj_handle_t. However, I agree that the check would be best inside of
create_named_object_dir, since nothing else in the creation paths is
going to use the root directory and the root directory will always be of
type "directory". I don't really have an opinion on whether a struct
object_attr is better than passing parameters explicitly.
--
Rob Shearman
More information about the wine-devel
mailing list