<commit_before>#pragma once

#include "ntddk.h"
#include "wdf.h"
#include "Alloc.h"

class CPreAllocatedDeviceInit : public CAllocatable<PagedPool, 'IDHR'>
{
public:
    CPreAllocatedDeviceInit()
    {}
    virtual ~CPreAllocatedDeviceInit()
    {}

    virtual void Attach(PWDFDEVICE_INIT DeviceInit);
    virtual PWDFDEVICE_INIT Detach();

    void Free();

    void SetExclusive()
    { WdfDeviceInitSetExclusive(m_DeviceInit, TRUE); }

    NTSTATUS SetRaw(CONST GUID* DeviceClassGuid)
    { return WdfPdoInitAssignRawDevice(m_DeviceInit, DeviceClassGuid); }

    void SetIoBuffered()
    { WdfDeviceInitSetIoType(m_DeviceInit, WdfDeviceIoBuffered); }

    void SetIoDirect()
    { WdfDeviceInitSetIoType(m_DeviceInit, WdfDeviceIoDirect); }

    void SetFilter()
    { WdfFdoInitSetFilter(m_DeviceInit); }
<commit_msg>UsbDk: Introduce method for device requests configuration<commit_after>#pragma once

#include "ntddk.h"
#include "wdf.h"
#include "Alloc.h"

class CPreAllocatedDeviceInit : public CAllocatable<PagedPool, 'IDHR'>
{
public:
    CPreAllocatedDeviceInit()
    {}
    virtual ~CPreAllocatedDeviceInit()
    {}

    virtual void Attach(PWDFDEVICE_INIT DeviceInit);
    virtual PWDFDEVICE_INIT Detach();

    void Free();

    void SetExclusive()
    { WdfDeviceInitSetExclusive(m_DeviceInit, TRUE); }

    NTSTATUS SetRaw(CONST GUID* DeviceClassGuid)
    { return WdfPdoInitAssignRawDevice(m_DeviceInit, DeviceClassGuid); }

    void SetIoBuffered()
    { WdfDeviceInitSetIoType(m_DeviceInit, WdfDeviceIoBuffered); }

    void SetIoDirect()
    { WdfDeviceInitSetIoType(m_DeviceInit, WdfDeviceIoDirect); }

    void SetFilter()
    { WdfFdoInitSetFilter(m_DeviceInit); }

    void SetRequestAttributes(WDF_OBJECT_ATTRIBUTES &Attributes)
    { WdfDeviceInitSetRequestAttributes(m_DeviceInit, &Attributes); }

{'fraction_non_alphanumeric': 0.09604829857299671, 'fraction_numerical': 0.0, 'mean_word_length': 4.938110749185668, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7103167', 'n_tokens_mistral': 618, 'n_tokens_neox': 597, 'n_words': 107}