Sample Code

Windows Driver Samples/ GPIO Sample Drivers/ C++/ simdeviceumdf/ internal.h/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*++
 
Copyright (C) Microsoft Corporation, All Rights Reserved
 
Module Name:
 
    Internal.h
 
Abstract:
 
    This module contains the local type definitions for the UMDF Echo
    driver sample.
 
 
Environment:
 
    Windows User-Mode Driver Framework (WUDF)
 
--*/
#ifndef _INTERNAL_H_
#define _INTERNAL_H_
 
#pragma once
 
#define UMDF_USING_NTSTATUS
 
#include <windows.h>
#include <winternl.h>
#include <ntstatus.h>
#include <strsafe.h>
#include <gpio.h>
 
_Analysis_mode_(_Analysis_code_type_user_driver_);  // Macro letting the compiler know this is not a kernel driver (this will help surpress needless warnings)
 
// Common WPD, UMDF, and WDM headers
#include <devioctl.h>
#include <initguid.h>
 
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
 
//
// Include the WUDF DDI
//
#include "wudfddi.h"
 
//
// Use specstrings for in/out annotation of function parameters.
//
 
#include "specstrings.h"
 
//
// Forward definitions of classes in the other header files.
//
 
typedef class CSimdeviceDriver *PCSimdeviceDriver;
typedef class CSimdevice *PCSimdevice;
typedef class CSimdeviceQueue  *PCSimdeviceQueue;
 
//
// Include the type specific headers.
//
 
#include "comsup.h"
#include "driver.h"
#include "device.h"
#include "queue.h"
 
__forceinline
#ifdef _PREFAST_
__declspec(noreturn)
#endif
VOID
WdfTestNoReturn(
    VOID
    )
{
    // do nothing.
}
 
#define WUDF_TEST_DRIVER_ASSERT(p)  \
{                                   \
    if ( !(p) )                     \
    {                               \
        DebugBreak();               \
        WdfTestNoReturn();          \
    }                               \
}
 
#define MYDRIVER_CLASS_ID   {0x7ab7dcf5, 0xd1d4, 0x4085, {0x95, 0x47, 0x1d, 0xb9, 0x68, 0xcc, 0xa7, 0x20}}
 
 
#define SAFE_RELEASE(p)     {if ((p)) { (p)->Release(); (p) = NULL; }}
#endif

Our Services

  • What our customers say about us?

© 2011-2025 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS