IWDFIoRequest2::GetCreateParametersEx method

The GetCreateParametersEx method retrieves file creation parameters that are associated with a file that is being created or opened.

Syntax


void GetCreateParametersEx(
  [out, optional] ULONG       *pOptions,
  [out, optional] USHORT      *pFileAttributes,
  [out, optional] USHORT      *pShareAccess,
  [out, optional] ACCESS_MASK *pDesiredAccess
);

Parameters

pOptions [out, optional]

A pointer to a caller-allocated variable that receives bit flags that indicate file creation options. These FILE_XXXX-named bit flags are defined in Wdm.h.

The low 24 bits of the variable indicate options to apply when creating or opening the file. For more information about these bits, see the description of the CreateOptions parameter of the kernel-mode ZwCreateFile function.

The high eight bits of the variable indicate actions to perform if the file does or does not already exist. For more information about these bits, see the description of the CreateDisposition parameter of ZwCreateFile.

This parameter is optional and can be NULL.

pFileAttributes [out, optional]

A pointer to a caller-allocated variable that receives bit flags that indicate file attributes. These FILE_ATTRIBUTE_XXXX-named bit flags are defined in Wdm.h. For more information about these bit flags, see the description of the FileAttributes parameter of ZwCreateFile.

This parameter is optional and can be NULL.

pShareAccess [out, optional]

A pointer to a caller-allocated variable that receives bit flags that indicate file sharing options. These FILE_SHARE_XXXX-named bit flags are defined in Wdm.h. For more information about these bit flags, see the description of the ShareAccess parameter of ZwCreateFile.

This parameter is optional and can be NULL.

pDesiredAccess [out, optional]

A pointer to a caller-allocated ACCESS_MASK structure that specifies the requested access to the file. For more information about this parameter, see the DesiredAccess parameter of ZwCreateFile.

This parameter is optional and can be NULL.

Return value

None.

Remarks

After the framework calls a driver's IQueueCallbackCreate::OnCreateFile callback function, the driver can call the IWDFIoRequest::GetCreateParameters method or the IWDFIoRequest2::GetCreateParametersEx method to obtain the file's creation parameters.

For more information, see Obtaining Parameters for I/O Requests.

Examples

The following code example shows how an IQueueCallbackCreate::OnCreateFile callback function can obtain the IWDFIoRequest2 interface and then call GetCreateParametersEx.


VOID
OnCreateFile(
    __in IWDFIoQueue* FxQueue,
    __in IWDFIoRequest* FxRequest,
    __in IWDFFile* FxFile
    )
{
    ULONG fileOptions;
    USHORT fileAttributes,
    USHORT shareAccess,
    ACCESS_MASK desiredAccess;
    ...
    CComQIPtr<IWDFIoRequest2> fxRequest2(FxRequest);
    fxRequest2->GetCreateParametersEx(&fileOptions
                                      &fileAttributes,
                                      &shareAccess,
                                      &desiredAccess);
    ...
}

Requirements

Target platform

Desktop

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.9

Header

Wudfddi.h (include Wudfddi.h)

DLL

WUDFx.dll

See also

IWDFIoRequest2
IQueueCallbackCreate::OnCreateFile
IWDFIoRequest::GetCreateParameters

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft