ntoskrnl: Implement server side of get_device

Vitaliy Margolen wine-devel at kievinfo.com
Wed Sep 17 09:09:13 CDT 2008


Peter Dons Tychsen wrote:
> Implement server side of get_device to complete the
> IoGetDeviceObjectPointer() function.
> 
> /pedro

My first question: what will you do with that pointer if that driver is
loaded in the separate instance of ntoskrnl? Driver that calls
IoGetDeviceObjectPointer will most likely try to dereference the pointer it
got back.

> +/* locate a device */
> +DECL_HANDLER(get_device)
> +{
> +    struct unicode_str name;
> +    get_req_unicode_str( &name );
> +
> +    /* lookup the device */
> +    struct device *device = open_object_dir(NULL, &name, 0, &device_ops);
> +    if(!device)
> +    {
> +        return;
> +    }
> +
> +    /* fill reply */
> +    reply->handle = alloc_handle(current->process, device, req->access, 0);....
> +    reply->user_ptr = device->user_ptr;
> +

You leaking reference to device here. Need release_object( device );

In your patch please include changes to server/protocol.def only and not any
other automatically generated files. Make it a separate commit in your tree
and just don't send it to wine-patches.

Vitaliy



More information about the wine-devel mailing list